mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-28 16:20:50 +00:00
[win] Fix crash browsing files when a folder is deleted (fix #2950)
This commit is contained in:
parent
f886e85af9
commit
c457f1680a
@ -973,6 +973,13 @@ static FileItem* get_fileitem_by_fullpidl(LPITEMIDLIST fullpidl, bool create_if_
|
||||
|
||||
free_pidl(parent_fullpidl);
|
||||
|
||||
// The parent folder is sometimes deleted for some reasons. In
|
||||
// that case, m_parent becomes nullptr, which can causes crash.
|
||||
if (fileitem->m_parent == nullptr) {
|
||||
throw std::runtime_error(
|
||||
"Unexpected file system change. Please check the file.");
|
||||
}
|
||||
|
||||
// Get specific pidl attributes
|
||||
if (fileitem->m_pidl &&
|
||||
fileitem->m_parent) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user