File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,7 @@ void Sol2ScriptingEnvironment::InitContext(LuaScriptingContext &context)
259
259
" version" ,
260
260
&osmium::Way::version,
261
261
" get_nodes" ,
262
- [](const osmium::Way &way) { return sol::as_table (&way.nodes ()); },
262
+ [&context ](const osmium::Way &way) { return sol::as_table (&way.nodes ()); },
263
263
" get_location_tag" ,
264
264
[&context, &get_location_tag](const osmium::Way &way, const char *key) {
265
265
// HEURISTIC: use a single node (last) of the way to localize the way
@@ -944,6 +944,9 @@ Sol2ScriptingEnvironment::GetStringListFromTable(const std::string &table_name)
944
944
auto &context = GetSol2Context ();
945
945
BOOST_ASSERT (context.state .lua_state () != nullptr );
946
946
std::vector<std::string> strings;
947
+ if (context.profile_table [table_name] == sol::nil){
948
+ return strings;
949
+ }
947
950
sol::table table = context.profile_table [table_name];
948
951
if (table.valid ())
949
952
{
@@ -962,6 +965,9 @@ Sol2ScriptingEnvironment::GetStringListsFromTable(const std::string &table_name)
962
965
963
966
auto &context = GetSol2Context ();
964
967
BOOST_ASSERT (context.state .lua_state () != nullptr );
968
+ if (context.profile_table [table_name] == sol::nil){
969
+ return string_lists;
970
+ }
965
971
sol::table table = context.profile_table [table_name];
966
972
if (!table.valid ())
967
973
{
You can’t perform that action at this time.
0 commit comments