Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Unbreak updating games list if user is logged in to Amazon account, but has no games installed. #3016

Conversation

rdbrschf
Copy link
Contributor

If no game is installed, nile list-updates will return an empty string. Unfortunately, this is not valid JSON and JSON.parse() later bails out with an error.

We're good to go if no game is installed either way, so break out early and don't try to parse an empty string.


Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

…acefully.

If no game is installed, nile list-updates will return an empty string.
Unfortunately, this is not valid JSON and JSON.parse() later bails out
with an error.

We're good to go if no game is installed either way, so break out early
and don't try to parse an empty string.
@arielj arielj added this to the 2.9.2 milestone Aug 30, 2023
@CommandMC
Copy link
Collaborator

IMO the "better" fix here would be modifying Nile so it does return valid JSON (to be specific, an empty array) in this case

@rdbrschf
Copy link
Contributor Author

rdbrschf commented Sep 2, 2023

That would also work, sure. But making Heroic resilient to empty strings also doesn't sound like a bad idea. I'd do both, really.

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flavioislima
Copy link
Member

That would also work, sure. But making Heroic resilient to empty strings also doesn't sound like a bad idea. I'd do both, really.

Agreed and thanks for the fix ⚔️

@flavioislima flavioislima merged commit 0487dab into Heroic-Games-Launcher:main Sep 5, 2023
13 checks passed
@rdbrschf
Copy link
Contributor Author

rdbrschf commented Oct 1, 2023

X-ref for nile: imLinguin/nile#41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants