From a871b15fe992a39ada76d6e3495892ed3bee1dee Mon Sep 17 00:00:00 2001 From: Surinder Kumar Date: Wed, 8 Jun 2016 12:46:30 +0100 Subject: [PATCH] When any of the docked tab(statistics, dependents & dependencies) are clicked without selecting any tree node. it gives error in browser console panel. Because the node passed is undefined. and check is missing. This is now fixed by adding check for node passed. --- web/pgadmin/misc/depends/static/js/depends.js | 6 ++++++ web/pgadmin/misc/statistics/static/js/statistics.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/web/pgadmin/misc/depends/static/js/depends.js b/web/pgadmin/misc/depends/static/js/depends.js index c92085eec..d7534c882 100644 --- a/web/pgadmin/misc/depends/static/js/depends.js +++ b/web/pgadmin/misc/depends/static/js/depends.js @@ -236,6 +236,9 @@ define( * through. We will wait for some time before fetching the Dependents **/ var self = this; + if (!node) { + return; + } self.dependent = true; if (self.timeout) { clearTimeout(self.timeout); @@ -275,6 +278,9 @@ define( * through. We will wait for some time before fetching the Dependencies **/ var self = this; + if (!node) { + return; + } self.dependent = false; if (self.timeout) { clearTimeout(self.timeout); diff --git a/web/pgadmin/misc/statistics/static/js/statistics.js b/web/pgadmin/misc/statistics/static/js/statistics.js index 0e656bb10..019902b19 100644 --- a/web/pgadmin/misc/statistics/static/js/statistics.js +++ b/web/pgadmin/misc/statistics/static/js/statistics.js @@ -218,6 +218,9 @@ function(_, $, pgBrowser, Backgrid) { showStatistics: function(item, data, node) { var self = this; + if (!node) { + return; + } /** * We can't start fetching the statistics immediately, it is possible - * the user is just using keyboards to select the node, and just