浏览代码

Fix crash on loading vmap's

Ivan Savenko 1 年之前
父节点
当前提交
4947baebee
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      lib/mapObjects/CQuest.cpp

+ 3 - 0
lib/mapObjects/CQuest.cpp

@@ -684,6 +684,9 @@ void CGSeerHut::serializeJsonOptions(JsonSerializeFormat & handler)
 		//backward compatibility for VCMI maps that use old SeerHut format
 		auto s = handler.enterStruct("reward");
 		const JsonNode & rewardsJson = handler.getCurrent();
+
+		if (rewardsJson.Struct().empty())
+			return;
 		
 		std::string fullIdentifier;
 		std::string metaTypeName;