Browse Source

Lua: Add check for __enum__field in Boot.instanceOf

Justin Donaldson 9 years ago
parent
commit
6f241bd5b5
1 changed files with 3 additions and 1 deletions
  1. 3 1
      std/lua/Boot.hx

+ 3 - 1
std/lua/Boot.hx

@@ -107,7 +107,9 @@ class Boot {
 			case Dynamic:
 			case Dynamic:
 				return true;
 				return true;
 			default: {
 			default: {
-				if ( untyped o.__enum__ != null ){
+				if (o == null) {
+					return false;
+				} else if ( untyped o.__enum__ != null ){
 					return o.__enum__ == cl;
 					return o.__enum__ == cl;
 				} else if (   untyped __type__(o)  == "table"
 				} else if (   untyped __type__(o)  == "table"
 					&& untyped __type__(cl) == "table"){
 					&& untyped __type__(cl) == "table"){