Ryujinx
Ryujinx copied to clipboard
Catch Profile.json parse to prevent crash on launch
Handles the Profile JSON parsing in a try catch so the application does not crash on launch, but instead loads the default profile.
Closes #3355.
Download the artifacts for this pull request:
- ryujinx-Release-1.1.0+840d34b-linux_x64
- ryujinx-Release-1.1.0+840d34b-osx_x64
- ryujinx-Release-1.1.0+840d34b-win_x64
Experimental GUI (Avalonia)
GUI-less (SDL2)
Only for Developers
- ava-ryujinx-Debug-1.1.0+840d34b-linux_x64
- ava-ryujinx-Debug-1.1.0+840d34b-osx_x64
- ava-ryujinx-Debug-1.1.0+840d34b-win_x64
- ryujinx-Debug-1.1.0+840d34b-linux_x64
- ryujinx-Debug-1.1.0+840d34b-osx_x64
- ryujinx-Debug-1.1.0+840d34b-win_x64
- sdl2-ryujinx-headless-Debug-1.1.0+840d34b-linux_x64
- sdl2-ryujinx-headless-Debug-1.1.0+840d34b-osx_x64
- sdl2-ryujinx-headless-Debug-1.1.0+840d34b-win_x64
Sorry, this PR completely slipped my mind.
@AcK77 Is there anything you'd like me to address? I don't think anything needs to be cleaned, the existing Profiles.json will just get populated with a working profile again. The orphaned save files are an issue, but at this point the JSON is already corrupted. On top of that, I think the save manager will help users with recovering their saves now.
@AcK77 Is there anything you'd like me to address? I don't think anything needs to be cleaned, the existing Profiles.json will just get populated with a working profile again. The orphaned save files are an issue, but at this point the JSON is already corrupted. On top of that, I think the save manager will help users with recovering their saves now.
You only assign the default UserId if the parsing failed (LastOpened = AccountManager.DefaultUserId
). So the Profiles.json
will not be populated with a working profile except if I miss something.
I agree for the orphaned save files, those could be recovered by the save manager now ;)
@AcK77 I just tried it and when I break the json (just {} as content), the catch picks it up and generates a default RyuPlayer profile with: "user_id": "00000000000000010000000000000000", "last_opened": "00000000000000010000000000000000"
This is the default UserId as far as I'm aware?
@AcK77 I just tried it and when I break the json (just {} as content), the catch picks it up and generates a default RyuPlayer profile with: "user_id": "00000000000000010000000000000000", "last_opened": "00000000000000010000000000000000"
This is the default UserId as far as I'm aware?
After a quick check, it's because the user is opened as default, so it's save the JSON to write the account state. Your change should be enough (with my latest comment applied).