1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-09 16:21:51 +00:00

Fix unhandled savegame error not being displayed

Move the file loading code into the try/catch block, as it can and will
produce errors eventually.
This commit is contained in:
Даниїл Григор'єв 2025-05-04 03:19:22 +03:00
parent 2b890466b0
commit 3abfa9c35d
No known key found for this signature in database
GPG Key ID: B890DF16341D8C1D

View File

@ -138,14 +138,14 @@ export class MainMenuState extends GameState {
const closeLoader = this.dialogs.showLoadingDialog();
await waitNextFrame();
const data = await this.app.storage.requestOpenFile("bin");
if (data === undefined) {
// User canceled the request
closeLoader();
return;
}
try {
const data = await this.app.storage.requestOpenFile("bin");
if (data === undefined) {
// User canceled the request
closeLoader();
return;
}
this.app.savegameMgr.importSavegame(data);
closeLoader();
this.dialogs.showWarning(