Skip to content

Commit 1ce573e

Browse files
committed
Fix lua nil for MacOS
1 parent cf13a97 commit 1ce573e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/extractor/scripting_environment_lua.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct to_lua_object : public boost::static_visitor<sol::object>
8888
{
8989
to_lua_object(sol::state &state) : state(state) {}
9090
template <typename T> auto operator()(T &v) const { return sol::make_object(state, v); }
91-
auto operator()(boost::blank &) const { return sol::nil; }
91+
auto operator()(boost::blank &) const { return sol::lua_nil; }
9292
sol::state &state;
9393
};
9494
} // namespace
@@ -236,7 +236,7 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
236236

237237
auto get_location_tag = [](auto &context, const auto &location, const char *key) {
238238
if (context.location_dependent_data.empty())
239-
return sol::object(sol::nil);
239+
return sol::object(sol::lua_nil);
240240

241241
const LocationDependentData::point_t point{location.lon(), location.lat()};
242242
if (!boost::geometry::equals(context.last_location_point, point))
@@ -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] == sol::nil)
946+
if (context.profile_table[table_name] == nullptr)
947947
{
948948
return strings;
949949
}
@@ -965,7 +965,7 @@ Sol2ScriptingEnvironment::GetStringListsFromTable(const std::string &table_name)
965965

966966
auto &context = GetSol2Context();
967967
BOOST_ASSERT(context.state.lua_state() != nullptr);
968-
if (context.profile_table[table_name] == sol::nil)
968+
if (context.profile_table[table_name] == nullptr)
969969
{
970970
return string_lists;
971971
}

0 commit comments

Comments
 (0)