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
Crash if ProgramData is undefined in Environmental variables. #23
Comments
Hi @NathanaelA thanks for report. Is there any valid scenario when %Programdata% is unset? What was your case? Defaulting to C:\ProgramData looks reasonable.. however system drive letter could be not "C" as well. Maybe |
ah, Wine. Sure, no reason to be stubborn here :) Would like like to submit PR? |
Add fallback for missing environment variable ProgramData (#23)
Describe the bug
If ProgramData is not defined in the environment the plugin crashes here:
galaxy-integration-origin/src/local_games.py
Line 247 in 0aa5832
To Reproduce
Set ProgramData=
Start GOG and see if disconnect immediately and be in a crashed state crashed
Expected behavior
It assumes that ProgramData will always be defined, I expect it not to crash if somehow this isn't set...
Fix
Replace:
local_content_path = os.path.join(os.environ["ProgramData"], "Origin", "LocalContent")
with
local_content_path = os.path.join(os.environ.get("ProgramData","C:\ProgramData"), "Origin", "LocalContent")
As it will allow the normal value to be used if ProgramData is not set...
Relevant Log
The text was updated successfully, but these errors were encountered: