From 6aae9d6e202c2f03280b0660b9b18954137b12bb Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Thu, 7 Mar 2019 15:22:45 +0000 Subject: [PATCH] Handle resultsets with zero columns correctly in the Query Tool. Fixes #4054 --- docs/en_US/release_notes_4_4.rst | 1 + web/pgadmin/tools/sqleditor/static/js/sqleditor.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/en_US/release_notes_4_4.rst b/docs/en_US/release_notes_4_4.rst index f7d264fc9..d8c818dd0 100644 --- a/docs/en_US/release_notes_4_4.rst +++ b/docs/en_US/release_notes_4_4.rst @@ -15,3 +15,4 @@ Features Bug fixes ********* +| `Bug #4054 `_ - Handle resultsets with zero columns correctly in the Query Tool. \ No newline at end of file diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index e7e953dd9..7b4da193f 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -2349,7 +2349,7 @@ define('tools.querytool', [ var explain_data_array = [], explain_data_json = null; - if(data.types[0].typname === 'json') { + if(data.types[0] && data.types[0].typname === 'json') { /* json is sent as text, parse it */ explain_data_json = JSON.parse(data.result[0]);