Skip to content

Commit 5aa95fe

Browse files
authoredOct 5, 2021
Make MetaDataRef:get return nil instead of nothing (#11666)
1 parent 4fca601 commit 5aa95fe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎src/script/lua_api/l_metadata.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ int MetaDataRef::l_get(lua_State *L)
8282
std::string str;
8383
if (meta->getStringToRef(name, str)) {
8484
lua_pushlstring(L, str.c_str(), str.size());
85-
return 1;
85+
} else {
86+
lua_pushnil(L);
8687
}
87-
return 0;
88+
return 1;
8889
}
8990

9091
// get_string(self, name)

0 commit comments

Comments
 (0)
Please sign in to comment.