From 312fa11601f7117fe5d65291684bd1a289374d0c Mon Sep 17 00:00:00 2001 From: Matthew Malensek Date: Wed, 25 Mar 2015 06:08:39 -0600 Subject: [PATCH] Check for GetModuleFileName success --- 3RVX/Settings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/3RVX/Settings.cpp b/3RVX/Settings.cpp index 2c0bc801..d6587380 100644 --- a/3RVX/Settings.cpp +++ b/3RVX/Settings.cpp @@ -80,8 +80,9 @@ int Settings::Save() { std::wstring Settings::AppDir() { if (_appDir.empty()) { wchar_t path[MAX_PATH] = { 0 }; - GetModuleFileName(NULL, path, MAX_PATH); - PathRemoveFileSpec(path); + if (GetModuleFileName(NULL, path, MAX_PATH)) { + PathRemoveFileSpec(path); + } _appDir = std::wstring(path); } return _appDir;