aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib')
-rw-r--r--js/lib/rdge/texture.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js
index 498dcf3b..bd8e6198 100644
--- a/js/lib/rdge/texture.js
+++ b/js/lib/rdge/texture.js
@@ -68,9 +68,12 @@ function Texture( dstWorld, texMapName, wrap, mips )
68 { 68 {
69 // determine if the source is a canvas or an image file 69 // determine if the source is a canvas or an image file
70 var viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils; 70 var viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils;
71 var root = viewUtils.application.ninja.currentDocument.documentRoot; 71 //var root = viewUtils.application.ninja.currentDocument.documentRoot;
72 var root;
73 if (viewUtils.application.ninja.currentDocument)
74 root = viewUtils.application.ninja.currentDocument.model.documentRoot;
72 var srcCanvas = this._srcCanvas; 75 var srcCanvas = this._srcCanvas;
73 if (!srcCanvas) 76 if (!srcCanvas && root)
74 srcCanvas = this.findCanvas( this._texMapName, root ); 77 srcCanvas = this.findCanvas( this._texMapName, root );
75 if (srcCanvas) 78 if (srcCanvas)
76 { 79 {