diff --git a/waifu2x-caffe-gui/MainDialog.cpp b/waifu2x-caffe-gui/MainDialog.cpp index 509fd21..e982123 100644 --- a/waifu2x-caffe-gui/MainDialog.cpp +++ b/waifu2x-caffe-gui/MainDialog.cpp @@ -1287,7 +1287,7 @@ UINT_PTR DialogEvent::OFNHookProcOut(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARA szPath[_countof(szPath) - 1] = TEXT('\0'); boost::filesystem::path p(szPath); - if (boost::filesystem::is_empty(szPath) || boost::filesystem::is_directory(szPath)) + if (boost::filesystem::exists(p) && (boost::filesystem::is_empty(p) || boost::filesystem::is_directory(p))) { const auto filename = getTString(p.filename());