From 5c60a99cc4e8f1dd8f9662816eb449c3df5a4d81 Mon Sep 17 00:00:00 2001 From: scribam Date: Wed, 5 Jul 2017 17:07:32 +0200 Subject: [PATCH] Check if the pth is a valid directory before to look for icons. --- rpcs3/rpcs3qt/main_window.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 82cc9c4182..c1ce472dc5 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -155,9 +155,11 @@ void main_window::SetAppIconFromPath(const std::string path) // get Icon for the gs_frame from path. this handles presumably all possible use cases QString qpath = qstr(path); std::string icon_list[] = { "/ICON0.PNG", "/PS3_GAME/ICON0.PNG" }; - std::string path_list[] = { path, sstr(qpath.section("/", 0, -2)) ,sstr(qpath.section("/", 0, -3)) }; + std::string path_list[] = { path, sstr(qpath.section("/", 0, -2)), sstr(qpath.section("/", 0, -3)) }; for (std::string pth : path_list) { + if (!fs::is_dir(pth)) continue; + for (std::string ico : icon_list) { ico = pth + ico;