App doesn't crash when attempting to open bad file through double click
This commit is contained in:
parent
354c6e4cdc
commit
12bb936c16
5 changed files with 11 additions and 15 deletions
16
src/main.cpp
16
src/main.cpp
|
|
@ -560,19 +560,17 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) {
|
|||
mS.m->set_first_screen(std::make_unique<FileSelectScreen>(*mS.m));
|
||||
else {
|
||||
mS.m->set_first_screen(std::make_unique<DesktopDrawingProgramScreen>(*mS.m));
|
||||
if(listOfFilesToOpenFromCommand.empty()) {
|
||||
for(std::filesystem::path& f : listOfFilesToOpenFromCommand) {
|
||||
mS.m->create_new_tab({
|
||||
.isClient = false,
|
||||
.filePathSource = f
|
||||
});
|
||||
}
|
||||
if(mS.m->worlds.empty()) {
|
||||
mS.m->create_new_tab({
|
||||
.isClient = false
|
||||
});
|
||||
}
|
||||
else {
|
||||
for(std::filesystem::path& f : listOfFilesToOpenFromCommand) {
|
||||
mS.m->create_new_tab({
|
||||
.isClient = false,
|
||||
.filePathSource = f
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mS.m->update(); // Run update once to make sure that callbacks dont crash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue