Mercurial > hg > orthanc
diff Core/Lua/LuaContext.cpp @ 2220:0fb6e0461105
fix handling of Booleans in Lua
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 13 Dec 2016 11:43:35 +0100 |
parents | b1291df2f780 |
children | a3a65de1840f |
line wrap: on
line diff
--- a/Core/Lua/LuaContext.cpp Tue Dec 13 11:06:41 2016 +0100 +++ b/Core/Lua/LuaContext.cpp Tue Dec 13 11:43:35 2016 +0100 @@ -497,6 +497,10 @@ // Lua can convert most types to strings by default. result = std::string(lua_tostring(lua_, top)); } + else if (lua_isboolean(lua_, top)) + { + result = lua_toboolean(lua_, top) ? true : false; + } else { LOG(WARNING) << "Unsupported Lua type when returning Json";