summaryrefslogtreecommitdiff
path: root/source/tools/murun.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools/murun.c')
-rw-r--r--source/tools/murun.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c
index ea66f0ac..6754b32e 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -1648,13 +1648,17 @@ static void ffi_Document_getMetaData(js_State *J)
fz_document *doc = ffi_todocument(J, 0);
const char *key = js_tostring(J, 1);
char info[256];
+ int found;
fz_try(ctx)
- fz_lookup_metadata(ctx, doc, key, info, sizeof info);
+ found = fz_lookup_metadata(ctx, doc, key, info, sizeof info);
fz_catch(ctx)
rethrow(J);
- js_pushstring(J, info);
+ if (found)
+ js_pushstring(J, info);
+ else
+ js_pushundefined(J);
}
static void ffi_Document_isReflowable(js_State *J)