From aaf19b54635df17c5c426c04e06f34ef77fe85e9 Mon Sep 17 00:00:00 2001 From: Anonymous275 <36374260+Anonymous-275@users.noreply.github.com> Date: Thu, 20 Jan 2022 03:57:20 +0200 Subject: [PATCH] Added Fatal error case for SHGetKnownFolderPath --- src/Launcher.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Launcher.cpp b/src/Launcher.cpp index f709d4d..90e1f56 100644 --- a/src/Launcher.cpp +++ b/src/Launcher.cpp @@ -134,7 +134,11 @@ std::string Launcher::GetLocalAppdata() { PWSTR folderPath = nullptr; 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); std::string Path((char*)bstrPath);