From c91c100102a15cb2fae1f9e7ecc801fb990532b9 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Wed, 24 Jul 2013 02:20:42 +0200 Subject: [PATCH] Fix graph resize bug when no graph exists. --- web/static/js/graph.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/web/static/js/graph.js b/web/static/js/graph.js index ffb6ce919..459a002cc 100644 --- a/web/static/js/graph.js +++ b/web/static/js/graph.js @@ -482,10 +482,12 @@ Prometheus.Graph.prototype.updateGraph = function(reloadGraph) { Prometheus.Graph.prototype.resizeGraph = function() { var self = this; - self.rickshawGraph.configure({ - width: Math.max(self.graph.innerWidth() - 80, 200), - }); - self.rickshawGraph.render(); + if (self.rickshawGraph != null) { + self.rickshawGraph.configure({ + width: Math.max(self.graph.innerWidth() - 80, 200), + }); + self.rickshawGraph.render(); + } } Prometheus.Graph.prototype.handleGraphResponse = function(json, textStatus) {