feat: Add if decrypt failed logic.

This commit is contained in:
sunwen
2025-03-21 14:24:18 +08:00
parent 2ed7ab751b
commit ed7a1206a1

View File

@@ -92,6 +92,10 @@ PatientData PatientDataReader::getPatientDataFromHJ(const std::string& aFilePath
stream.read(patientCString,aConfigHeader->getPatientLength()); stream.read(patientCString,aConfigHeader->getPatientLength());
std::string patientJsonString = patientCString; std::string patientJsonString = patientCString;
patientJsonString = AESEncryptHelper::decrypt(patientJsonString); patientJsonString = AESEncryptHelper::decrypt(patientJsonString);
if(patientJsonString.empty())
{
return result;
}
nlohmann::json jsonObj = nlohmann::json::parse(patientJsonString); nlohmann::json jsonObj = nlohmann::json::parse(patientJsonString);
if(!jsonObj.contains("Patient Info")) if(!jsonObj.contains("Patient Info"))
{ {