App doesn't crash when attempting to open bad file through double click

This commit is contained in:
Yousef Khadadeh 2026-06-04 17:16:26 +03:00
parent 354c6e4cdc
commit 12bb936c16
5 changed files with 11 additions and 15 deletions

View file

@ -108,9 +108,7 @@ void DesktopDrawingProgramScreen::on_tab_close() {
main.create_new_tab({
.isClient = false
});
else if(main.world)
main.worldIndex = std::find(main.worlds.begin(), main.worlds.end(), main.world) - main.worlds.begin();
else
else if(!main.world)
main.switch_to_tab(0);
}