feat: Add if decrypt failed logic.
This commit is contained in:
@@ -91,7 +91,11 @@ PatientData PatientDataReader::getPatientDataFromHJ(const std::string& aFilePath
|
|||||||
char* patientCString = new char[aConfigHeader->getPatientLength()];
|
char* patientCString = new char[aConfigHeader->getPatientLength()];
|
||||||
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"))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user