diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 35d1952c5..0e40ac4ac 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1314,6 +1314,7 @@ MAX_RADIUS defines the outer bound of the radius table, so leave it at 15 (pr #613 by argrath) variable attknum was declared without initialization, and was used in find_roll_to_hit() (pr #615 by argrath) +check for NULL lua_State before calling lua_close() (pr #616 by argrath) Code Cleanup and Reorganization diff --git a/src/nhlua.c b/src/nhlua.c index 92a942b92..db4deb6c4 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -1375,7 +1375,8 @@ nhl_init(void) void nhl_done(lua_State *L) { - lua_close(L); + if (L) + lua_close(L); iflags.in_lua = FALSE; }