Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit e79732b

Browse files
committed
修复上传图片的错误.
1 parent 4811f2c commit e79732b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/mirai_bot.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,8 @@ namespace Cyan
458458
json re_json = ParseOrThrowException(res);
459459
MiraiImage img;
460460
img.Id = re_json["imageId"].get<string>();
461-
img.Url = re_json["url"].get<string>();
462-
if (!re_json["path"].is_null())
463-
{
464-
img.Path = re_json["path"].get<string>();
465-
}
461+
img.Url = re_json.value("url", "");
462+
img.Path = re_json.value("path", "");
466463
return img;
467464
}
468465

0 commit comments

Comments
 (0)