From 403dada85a1e75859573a26ed54a72caa693da91 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Fri, 9 Sep 2016 11:47:13 -0400 Subject: Return nil on empty get_area() (#4508) --- src/script/lua_api/l_areastore.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/script/lua_api/l_areastore.cpp b/src/script/lua_api/l_areastore.cpp index 20e7875c7..0912e2ab0 100644 --- a/src/script/lua_api/l_areastore.cpp +++ b/src/script/lua_api/l_areastore.cpp @@ -111,6 +111,9 @@ int LuaAreaStore::l_get_area(lua_State *L) const Area *res; res = ast->getArea(id); + if (!res) + return 0; + push_area(L, res, include_borders, include_data); return 1; -- cgit v1.2.3