mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-06-19 23:20:57 +00:00
Added Fatal error case for SHGetKnownFolderPath
This commit is contained in:
+5
-1
@@ -134,7 +134,11 @@ std::string Launcher::GetLocalAppdata() {
|
|||||||
PWSTR folderPath = nullptr;
|
PWSTR folderPath = nullptr;
|
||||||
|
|
||||||
HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &folderPath);
|
HRESULT hr = SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, nullptr, &folderPath);
|
||||||
if (!SUCCEEDED(hr))return {};
|
|
||||||
|
if (!SUCCEEDED(hr)) {
|
||||||
|
LOG(FATAL) << "Failed to get path of localAppData";
|
||||||
|
throw ShutdownException("Fatal Error");
|
||||||
|
}
|
||||||
|
|
||||||
_bstr_t bstrPath(folderPath);
|
_bstr_t bstrPath(folderPath);
|
||||||
std::string Path((char*)bstrPath);
|
std::string Path((char*)bstrPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user