Fix crash on missing symbols.

Fixes #1487.
develop
Ben Lubar 2020-02-03 20:21:10 -06:00
parent 9c52b4e5e6
commit 321d948f8d
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
2 changed files with 6 additions and 1 deletions

@ -1922,6 +1922,10 @@ static void Lua::Core::InitCoreContext()
void DFHack::Lua::Core::Reset(color_ostream &out, const char *where) void DFHack::Lua::Core::Reset(color_ostream &out, const char *where)
{ {
// This can happen if DFHack fails to initialize.
if (!State)
return;
int top = lua_gettop(State); int top = lua_gettop(State);
if (top != 0) if (top != 0)

@ -254,6 +254,7 @@ namespace DFHack
}; };
void ValidateDescriptionOS() { void ValidateDescriptionOS() {
if (my_descriptor)
my_descriptor->ValidateOS(); my_descriptor->ValidateOS();
}; };