Skip to content

Commit c823bae

Browse files
committed
email_lib: treat digest field "structure" and "mimes" as optional
References: DESK-4124
1 parent ed96941 commit c823bae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/email/mjson.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ BOOL MJSON::load_from_json(const Json::Value &root) try
179179
pjson->flag = root["flag"].asBool();
180180
pjson->priority = root["priority"].asUInt();
181181
pjson->ref = base64_decode(root["ref"].asString());
182-
if (!mjson_parse_array(pjson, root["structure"], TYPE_STRUCTURE) ||
182+
if (root.isMember("structure") &&
183+
!mjson_parse_array(pjson, root["structure"], TYPE_STRUCTURE))
184+
return false;
185+
if (root.isMember("mimes") &&
183186
!mjson_parse_array(pjson, root["mimes"], TYPE_MIMES))
184187
return false;
185188
pjson->size = root["size"].asUInt();

0 commit comments

Comments
 (0)