Browse Source

Lua: add check for null metatables in Boot.instanceof

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

+ 1 - 1
std/lua/Boot.hx

@@ -109,7 +109,7 @@ class Boot {
 			default: {
 				if (   untyped __type__(o)  == "table"
 					&& untyped __type__(cl) == "table"){
-					while (Lua.getmetatable(o).__index != null){
+					while (Lua.getmetatable(o) != null && Lua.getmetatable(o).__index != null){
 						if (Lua.getmetatable(o).__index == cl.prototype) return true;
 						o = Lua.getmetatable(o).__index;
 					}