From b3e79477a6b187d824f3d323a25d3ed790ac8b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 22 May 2024 16:40:37 +0800 Subject: [PATCH] EDITOR: always print `exe` in JSON results --- src/modules/editor/editor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/editor/editor.c b/src/modules/editor/editor.c index 43d78f2a2..996096ce5 100644 --- a/src/modules/editor/editor.c +++ b/src/modules/editor/editor.c @@ -93,8 +93,11 @@ void ffGenerateEditorJsonResult(FF_MAYBE_UNUSED FFEditorOptions* options, yyjson yyjson_mut_val* obj = yyjson_mut_obj_add_obj(doc, module, "result"); yyjson_mut_obj_add_strbuf(doc, obj, "name", &result.name); - yyjson_mut_obj_add_strcpy(doc, obj, "exe", result.exe); yyjson_mut_obj_add_strbuf(doc, obj, "path", &result.path); + if (result.exe) + yyjson_mut_obj_add_strcpy(doc, obj, "exe", result.exe); + else + yyjson_mut_obj_add_null(doc, obj, "exe"); yyjson_mut_obj_add_strbuf(doc, obj, "version", &result.version); ffStrbufDestroy(&result.name);