From 41aba65c02f102834e0838464aa8fd249484d376 Mon Sep 17 00:00:00 2001 From: ASDF9999 Date: Mon, 26 Jun 2023 00:41:32 +0700 Subject: [PATCH] [fix] Fixed a bug where new users showed "Your save file is corrupted" due to a null exception --- src/ts/storage/globalApi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/storage/globalApi.ts b/src/ts/storage/globalApi.ts index ceaaea86..662ad1b8 100644 --- a/src/ts/storage/globalApi.ts +++ b/src/ts/storage/globalApi.ts @@ -310,7 +310,8 @@ export async function loadData() { else{ let gotStorage:Uint8Array = await forageStorage.getItem('database/database.bin') if(checkNullish(gotStorage)){ - await forageStorage.setItem('database/database.bin', encodeRisuSave({})) + gotStorage = encodeRisuSave({}) + await forageStorage.setItem('database/database.bin', gotStorage) } try { setDatabase(