From 73dcb13619fc6603be628a7eea275ea02818c1ce Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Thu, 6 Jun 2019 18:39:34 -0400 Subject: web_browser: Only delete temporary directory if it was created Prevents crashes with ShopN applet occasionally. --- src/core/hle/service/am/applets/web_browser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/am/applets/web_browser.cpp b/src/core/hle/service/am/applets/web_browser.cpp index 58efebf06..3c3af476c 100644 --- a/src/core/hle/service/am/applets/web_browser.cpp +++ b/src/core/hle/service/am/applets/web_browser.cpp @@ -285,7 +285,9 @@ void WebBrowser::Finalize() { broker.PushNormalDataFromApplet(IStorage{data}); broker.SignalStateChanged(); - FileUtil::DeleteDirRecursively(temporary_dir); + if (!temporary_dir.empty() && FileUtil::IsDirectory(temporary_dir)) { + FileUtil::DeleteDirRecursively(temporary_dir); + } } void WebBrowser::InitializeInternal() { -- cgit v1.2.3