CommandOption: fixes segfault with unknown module

This commit is contained in:
Carter Li
2026-05-13 19:28:36 +08:00
parent 8067e43631
commit 7f9b6187a6
+1 -1
View File
@@ -178,7 +178,7 @@ static bool parseStructureCommand(
}
}
if (fn == genJsonResult) {
if (data->resultDoc) {
yyjson_mut_doc* doc = data->resultDoc;
yyjson_mut_val* module = yyjson_mut_arr_add_obj(doc, doc->root);
yyjson_mut_obj_add_str(doc, module, "type", line);