瀏覽代碼

Fix null access on engine id

clementlandrin 11 月之前
父節點
當前提交
bdf2d02fab
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      hxd/fs/LocalFileSystem.hx

+ 3 - 1
hxd/fs/LocalFileSystem.hx

@@ -246,7 +246,9 @@ class LocalEntry extends FileEntry {
 		#if multidriver
 		if (watchByEngine == null)
 			watchByEngine = [];
-		watchByEngine[h3d.Engine.getCurrent().id] = onChanged;
+		var engine = h3d.Engine.getCurrent();
+		if ( engine != null )
+			watchByEngine[engine.id] = onChanged;
 		#end
 
 		watchCallback = function() {