From: Dan Vanderkam Date: Sat, 23 Oct 2010 06:13:20 +0000 (-0400) Subject: pull in ron's patch X-Git-Tag: v1.0.0~620 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=b304aaecb6728af27bc6f7e2b553570556e85e45;p=dygraphs.git pull in ron's patch --- diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 0aa7ca1..c6c5b1e 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -347,15 +347,15 @@ DygraphCanvasRenderer.prototype.clear = function() { for (var i = 0; i < this.xlabels.length; i++) { var el = this.xlabels[i]; - el.parentNode.removeChild(el); + if (el.parentNode) el.parentNode.removeChild(el); } for (var i = 0; i < this.ylabels.length; i++) { var el = this.ylabels[i]; - el.parentNode.removeChild(el); + if (el.parentNode) el.parentNode.removeChild(el); } for (var i = 0; i < this.annotations.length; i++) { var el = this.annotations[i]; - el.parentNode.removeChild(el); + if (el.parentNode) el.parentNode.removeChild(el); } this.xlabels = new Array(); this.ylabels = new Array();