diff --git a/Src/Json_Utilities.cpp b/Src/Json_Utilities.cpp index 0fc8c1e..28dafcd 100644 --- a/Src/Json_Utilities.cpp +++ b/Src/Json_Utilities.cpp @@ -407,10 +407,12 @@ std::string JsonFile_Parse(const char *path_to_file, Json_Value *pJson_Value) if (!err_str.empty()) return err_str; - // 尝试打开文件 + // 检查空指针 + if (pJson_Value == nullptr) + return "Null container ptr."; + + // 打开已完成检查的文件 FILE *pFile = fopen(path_to_file, "rb"); - if (pFile == nullptr) - return "file \"" + std::string(path_to_file) + "\" open failed."; // 跳过空白部分 return -> skip count auto Lambda_skip_blank = [&](void) -> size_t