diff options
Diffstat (limited to 'src/BLua.cc')
-rw-r--r-- | src/BLua.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/BLua.cc b/src/BLua.cc index d3e50b6..8d6b3ee 100644 --- a/src/BLua.cc +++ b/src/BLua.cc @@ -1066,7 +1066,7 @@ void Balau::LuaObjectFactory::pushMe(Lua & L, LuaObjectBase * o, const char * ob } Balau::LuaObjectBase * Balau::LuaObjectFactory::getMeInternal(Lua & L, int i) { - LuaObjectBase * o; + LuaObjectBase * o = NULL; if (L.istable(i)) { L.push("__obj"); @@ -1074,9 +1074,7 @@ Balau::LuaObjectBase * Balau::LuaObjectFactory::getMeInternal(Lua & L, int i) { if (!(o = (LuaObjectBase *) L.touserdata())) L.error("Table is not an object."); L.pop(); - } else if (L.isnil(i)) { - o = NULL; - } else { + } else if (!L.isnil(i)) { L.error("Not an object (not even a table)."); } |