Skip to content

Commit 1a5e5df

Browse files
committed
Use table lookup as boolean
1 parent 8510d68 commit 1a5e5df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/extractor/scripting_environment_lua.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ std::vector<std::string>
927927
Sol2ScriptingEnvironment::GetStringListFromFunction(const std::string &function_name)
928928
{
929929
auto &context = GetSol2Context();
930-
BOOST_ASSERT(context.state.lua_state() != nullptr);
930+
BOOST_ASSERT(context.state.lua_state());
931931
std::vector<std::string> strings;
932932
sol::function function = context.state[function_name];
933933
if (function.valid())
@@ -943,7 +943,7 @@ Sol2ScriptingEnvironment::GetStringListFromTable(const std::string &table_name)
943943
auto &context = GetSol2Context();
944944
BOOST_ASSERT(context.state.lua_state() != nullptr);
945945
std::vector<std::string> strings;
946-
if (context.profile_table[table_name] == nullptr)
946+
if (context.profile_table[table_name])
947947
{
948948
return strings;
949949
}

0 commit comments

Comments
 (0)