diff options
Diffstat (limited to 'src/script/lua_api/l_client.cpp')
-rw-r--r-- | src/script/lua_api/l_client.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp index 6c4878873..5e69d55dd 100644 --- a/src/script/lua_api/l_client.cpp +++ b/src/script/lua_api/l_client.cpp @@ -471,6 +471,8 @@ int ModApiClient::l_get_inventory(lua_State *L) try { inventory_location.deSerialize(location); inventory = client->getInventory(inventory_location); + if (! inventory) + throw SerializationError(std::string("Attempt to access nonexistant inventory (") + location + ")"); push_inventory(L, inventory); } catch (SerializationError &) { lua_pushnil(L); |