解析UI编辑器导出的json文件,ImageView路径空时崩溃

在ImageViewReader::setPropsFromJsonDictionary有这么两行:
const std::string& imageFilePath = DICTOOL->getStringValue_json(imageFileNameDic, P_Path);
if (!imageFilePath.empty()) {
这是cocostudio的解析UI文件的类,这两句是在解析json格式的文件,第一行读取ImageView类的path属性。
第二行则是对path是空时做了处理,即允许编辑器里ImageView的path为空。
实际情况是,当编辑器里ImageView的path为空时,上面第一句就崩了。
为什么?
当path为空时,json文件里是这么写的:“path”: null,
而不是:“path”: “”,
于是DICTOOL->getStringValue_json(imageFileNameDic, P_Path)返回的是nullptr
那么const std::string& imageFilePath = nullptr就崩了

推荐解决方案:
auto imageFilePath = DICTOOL->getStringValue_json(imageFileNameDic, P_Path);
if (imageFilePath && !std::string(imageFilePath).empty()) {