From 5d055d9fd20a2f4e5078bd722513ce905e9a6146 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 27 Mar 2012 11:33:28 -0700 Subject: Check for webGLWorld before calling draw. Signed-off-by: Nivesh Rajbhandari --- js/tools/EyedropperTool.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index 7458a9e8..d627f03b 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js @@ -395,9 +395,12 @@ exports.EyedropperTool = Montage.create(toolBase, { this._webGlWorld.importJSON(worldData); this._webGlWorld.render(); setTimeout(function() { - this._webGlWorld.draw(); - this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); - return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); + if(this._webGlWorld) + { + this._webGlWorld.draw(); + this._imageDataContext.drawImage(this._webGlDataCanvas, 0, 0); + return this._getColorFromCanvas(this._imageDataContext, tmpPt, true); + } }.bind(this), 250); } } -- cgit v1.2.3