Skip to content

Commit

Permalink
fix #481, determine whether the file exists when comparing files
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjiaodawang committed Oct 7, 2024
1 parent dac86a4 commit 3fc9bfb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pdf_viewer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,10 @@ MainWidget* get_window_with_opened_file_path(const std::wstring& file_path) {
std::string path1 = utf8_encode(window->doc()->get_path());
std::string path2 = utf8_encode(file_path);
#endif
if (std::filesystem::equivalent(path1, path2)) {
return window;
if (std::filesystem::exists(path1) && std::filesystem::exists(path2)) {
if (std::filesystem::equivalent(path1, path2)) {
return window;
}
}
}
}
Expand Down

0 comments on commit 3fc9bfb

Please sign in to comment.