Skip to content

Commit

Permalink
Merge pull request #1182 from jinjiaodawang/crash-fix
Browse files Browse the repository at this point in the history
fix #481, determine whether the file exists when comparing files
  • Loading branch information
ahrm authored Oct 9, 2024
2 parents dac86a4 + 3fc9bfb commit 8ae1f79
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 8ae1f79

Please sign in to comment.