diff options
author | Edwin Mons <edwin.mons@isode.com> | 2016-09-21 19:42:38 (GMT) |
---|---|---|
committer | Edwin Mons <edwin.mons@isode.com> | 2016-09-21 19:44:34 (GMT) |
commit | 82d4ca00958d6d097aee830ac300ecfd9014d2b3 (patch) | |
tree | f6b2182c6440b44e3ca5ef2e9a4431f343549a9c /Sluift/ElementConvertors | |
parent | 3fe4d78c15c289011493136c6360c14e755cabb3 (diff) | |
download | swift-82d4ca00958d6d097aee830ac300ecfd9014d2b3.zip swift-82d4ca00958d6d097aee830ac300ecfd9014d2b3.tar.bz2 |
Fix crash in Sluift CommandConvertor
If a command table contained actions or notes, an extraneous lua_pushnil
happened, leading to a crash.
Test-Information:
Rendering a command using to_xml with actions or notes now works as
expected on OS X 10.11
Change-Id: Ic99b2546ac261edf6b52b92e63701f397fc6201a
Diffstat (limited to 'Sluift/ElementConvertors')
-rw-r--r-- | Sluift/ElementConvertors/CommandConvertor.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/Sluift/ElementConvertors/CommandConvertor.cpp b/Sluift/ElementConvertors/CommandConvertor.cpp index 5bc3801..1e2f8e3 100644 --- a/Sluift/ElementConvertors/CommandConvertor.cpp +++ b/Sluift/ElementConvertors/CommandConvertor.cpp @@ -91,7 +91,6 @@ std::shared_ptr<Command> CommandConvertor::doConvertFromLua(lua_State* L) { lua_getfield(L, -1, "available_actions"); if (!lua_isnil(L, -1)) { Lua::checkType(L, -1, LUA_TTABLE); - lua_pushnil(L); for (lua_pushnil(L); lua_next(L, -2) != 0; ) { result->addAvailableAction(convertActionFromString(Lua::checkString(L, -1))); lua_pop(L, 1); @@ -102,7 +101,6 @@ std::shared_ptr<Command> CommandConvertor::doConvertFromLua(lua_State* L) { lua_getfield(L, -1, "notes"); if (!lua_isnil(L, -1)) { Lua::checkType(L, -1, LUA_TTABLE); - lua_pushnil(L); for (lua_pushnil(L); lua_next(L, -2) != 0; ) { Lua::checkType(L, -1, LUA_TTABLE); std::string note; |