(Windows) Trigger emergency shutdown on wide string conversion errors to preserve data integrity at all times.

This commit is contained in:
Leon Styhre 2022-08-13 16:27:44 +02:00
parent 63a5800e84
commit f6c109e3fc

View file

@ -13,6 +13,7 @@
#include "utils/StringUtil.h"
#include "Log.h"
#include "utils/PlatformUtil.h"
#include <algorithm>
#include <locale>
@ -624,6 +625,8 @@ namespace Utils
catch (...) {
LOG(LogError) << "StringUtil::stringToWideString(): Conversion failed, invalid "
"characters in source string?";
LOG(LogError) << stringArg;
Utils::Platform::emergencyShutdown();
return L"";
}
}
@ -637,6 +640,7 @@ namespace Utils
catch (...) {
LOG(LogError) << "StringUtil::wideStringToString(): Conversion failed, invalid "
"characters in source string?";
Utils::Platform::emergencyShutdown();
return "";
}
}