2
0
Эх сурвалжийг харах

check loader==null on access (close #194)

ncannasse 7 жил өмнө
parent
commit
29395eed84
1 өөрчлөгдсөн 3 нэмэгдсэн , 1 устгасан
  1. 3 1
      hxd/res/FileTree.hx

+ 3 - 1
hxd/res/FileTree.hx

@@ -221,7 +221,9 @@ class FileTree {
 					args : [],
 					ret : loaderType,
 					expr : macro {
-						return hxd.res.Loader.currentInstance;
+						var l = hxd.res.Loader.currentInstance;
+						if( l == null ) throw "Resource loader not initialized: call to hxd.Res.initXXX() required";
+						return l;
 					}
 				}),
 				pos : pos