Lua: don't die on unspecified detectors

This commit is contained in:
Přemysl Eric Janouch 2017-01-27 04:02:21 +01:00
parent 416b52083d
commit caa740df79
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 3 additions and 0 deletions

3
hex.c
View File

@ -1037,6 +1037,9 @@ app_lua_chunk_identify (lua_State *L)
struct app_lua_coder *coder; struct app_lua_coder *coder;
while ((coder = str_map_iter_next (&iter))) while ((coder = str_map_iter_next (&iter)))
{ {
if (coder->ref_detect == LUA_REFNIL)
continue;
lua_rawgeti (L, LUA_REGISTRYINDEX, coder->ref_detect); lua_rawgeti (L, LUA_REGISTRYINDEX, coder->ref_detect);
// Clone the chunk first to reset its read position // Clone the chunk first to reset its read position