aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-01-27 04:02:21 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2017-01-27 04:02:21 +0100
commitcaa740df79f1475374e0d0e0481567d120bd3789 (patch)
treeeed05c24f042f6782491f04936ad47e64824256a
parent416b52083d2357b950b3428364bf8e5548d0a23a (diff)
downloadhex-caa740df79f1475374e0d0e0481567d120bd3789.tar.gz
hex-caa740df79f1475374e0d0e0481567d120bd3789.tar.xz
hex-caa740df79f1475374e0d0e0481567d120bd3789.zip
Lua: don't die on unspecified detectors
-rw-r--r--hex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hex.c b/hex.c
index 5aa9220..9a0a0b2 100644
--- a/hex.c
+++ b/hex.c
@@ -1037,6 +1037,9 @@ app_lua_chunk_identify (lua_State *L)
struct app_lua_coder *coder;
while ((coder = str_map_iter_next (&iter)))
{
+ if (coder->ref_detect == LUA_REFNIL)
+ continue;
+
lua_rawgeti (L, LUA_REGISTRYINDEX, coder->ref_detect);
// Clone the chunk first to reset its read position