Skip to content

Commit cb7997e

Browse files
author
Adrien GIVRY
authored
Merge pull request #83 from zetsumi/fix/delete_folder
Editor crashes when deleting an already deleted file/folder
2 parents a1b552c + db6a889 commit cb7997e

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Sources/Overload/OvEditor/src/OvEditor/Panels/AssetBrowser.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,12 @@ class FolderContextualMenu : public BrowserItemContextualMenu
509509

510510
if (message.GetUserAction() == MessageBox::EUserAction::YES)
511511
{
512-
EDITOR_EXEC(PropagateFolderDestruction(filePath));
513-
std::filesystem::remove_all(filePath);
514-
DestroyedEvent.Invoke(filePath);
512+
if (std::filesystem::exists(filePath) == true)
513+
{
514+
EDITOR_EXEC(PropagateFolderDestruction(filePath));
515+
std::filesystem::remove_all(filePath);
516+
DestroyedEvent.Invoke(filePath);
517+
}
515518
}
516519
}
517520

0 commit comments

Comments
 (0)