Ensure the Query Tool doesn't throw an error when viewing the contents of a table with no columns. Fixes #4492

This commit is contained in:
Yosry Muhammad 2019-08-01 14:39:02 +01:00 committed by Dave Page
parent 76e658ee12
commit 97e39699ea
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ Bug fixes
| `Issue #4179 <https://redmine.postgresql.org/issues/4179>`_ - Fix generation of reverse engineered SQL for tables with Greenplum 5.x.
| `Issue #4401 <https://redmine.postgresql.org/issues/4401>`_ - Ensure type names are properly encoded in the results grid.
| `Issue #4490 <https://redmine.postgresql.org/issues/4490>`_ - Fix accessibility issue for checkbox in IE11.
| `Issue #4492 <https://redmine.postgresql.org/issues/4492>`_ - Ensure the Query Tool doesn't throw an error when viewing the contents of a table with no columns.
| `Issue #4496 <https://redmine.postgresql.org/issues/4496>`_ - Ensure columns can be created when they are IDENTITY fields with the CYCLE option enabled.
| `Issue #4497 <https://redmine.postgresql.org/issues/4497>`_ - Ensure purely numeric comments can be saved on new columns.
| `Issue #4508 <https://redmine.postgresql.org/issues/4508>`_ - Fix accessibility issue for Datetime cell in backgrid.

View File

@ -2467,8 +2467,8 @@ define('tools.querytool', [
var explain_data_array = [],
explain_data_json = null;
if(self.colinfo[0].name == 'QUERY PLAN' && data.result
if(data.result && !_.isEmpty(self.colinfo)
&& self.colinfo[0].name == 'QUERY PLAN' && !_.isEmpty(data.types)
&& data.types[0] && data.types[0].typname === 'json') {
/* json is sent as text, parse it */
explain_data_json = JSON.parse(data.result[0][0]);