Skip to content

Commit

Permalink
fix #321
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Mar 19, 2018
1 parent a724e74 commit 0b2a49e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Assets/XLua/Src/Editor/Template/LuaWrapPusher.tpl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ namespace XLua
if (type == LuaTypes.LUA_TUSERDATA )
{
val = (<%=full_type_name%>)FastGetCSObj(L, index);
}<%if not is_enum then%>
else if (type ==LuaTypes.LUA_TTABLE)
}
else if (type == LuaTypes.LUA_TTABLE)
{
val = new <%=full_type_name%>();
int top = LuaAPI.lua_gettop(L);
Expand All @@ -180,10 +180,14 @@ namespace XLua
}
LuaAPI.lua_pop(L, 1);
<%end)%>
}<%end%>
}<%if not type_info.Type.IsValueType then%>
else if (type == LuaTypes.LUA_TNIL || type == LuaTypes.LUA_TNONE)
{
val = null;
}<%end%>
else
{
val = (<%=full_type_name%>)objectCasters.GetCaster(typeof(<%=full_type_name%>))(L, index, null);
throw new Exception("can not cast " + LuaAPI.lua_type(L, index) + " to " + typeof(<%=full_type_name%>));
}
}
<%end)%>
Expand Down

0 comments on commit 0b2a49e

Please sign in to comment.