mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
(Windows) Trigger emergency shutdown on wide string conversion errors to preserve data integrity at all times.
This commit is contained in:
parent
63a5800e84
commit
f6c109e3fc
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
#include "utils/PlatformUtil.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
|
@ -624,6 +625,8 @@ namespace Utils
|
||||||
catch (...) {
|
catch (...) {
|
||||||
LOG(LogError) << "StringUtil::stringToWideString(): Conversion failed, invalid "
|
LOG(LogError) << "StringUtil::stringToWideString(): Conversion failed, invalid "
|
||||||
"characters in source string?";
|
"characters in source string?";
|
||||||
|
LOG(LogError) << stringArg;
|
||||||
|
Utils::Platform::emergencyShutdown();
|
||||||
return L"";
|
return L"";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -637,6 +640,7 @@ namespace Utils
|
||||||
catch (...) {
|
catch (...) {
|
||||||
LOG(LogError) << "StringUtil::wideStringToString(): Conversion failed, invalid "
|
LOG(LogError) << "StringUtil::wideStringToString(): Conversion failed, invalid "
|
||||||
"characters in source string?";
|
"characters in source string?";
|
||||||
|
Utils::Platform::emergencyShutdown();
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue