1
0
Fork 0

Make MetaDataRef:get return nil instead of nothing (#114)

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
minenux
luk3yx 2022-12-13 08:00:12 +13:00 committed by GitHub
parent 9985ffb2fc
commit c820cb204a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -82,9 +82,10 @@ int MetaDataRef::l_get(lua_State *L)
std::string str;
if (meta->getStringToRef(name, str)) {
lua_pushlstring(L, str.c_str(), str.size());
return 1;
} else {
lua_pushnil(L);
}
return 0;
return 1;
}
// get_string(self, name)