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

proton: Fix a couple simple crashes #6633

Open
wants to merge 1 commit into
base: proton_8.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions proton
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ class CompatData:
os.symlink("/", self.prefix_dir + "/dosdevices/z:")

# collect configuration info
steamdir = os.environ["STEAM_COMPAT_CLIENT_INSTALL_PATH"]
steamdir = os.environ.get("STEAM_COMPAT_CLIENT_INSTALL_PATH", "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We depend on Steam setting up this variable and using [] will make this fail in a clear way if this ever regresses in Steam.

By doing .get() the way you do here we would silence this but also copying of the steam DLLs would silently fail.


use_wined3d = "wined3d" in g_session.compat_config
use_dxvk_dxgi = not use_wined3d and \
Expand Down Expand Up @@ -1655,10 +1655,13 @@ if __name__ == "__main__":
if g_proton.missing_default_prefix():
g_proton.make_default_prefix()

g_session.init_session(sys.argv[1] != "runinprefix")
g_session.init_session(len(sys.argv) < 2 or sys.argv[1] != "runinprefix")

#determine mode
rc = 0
if len(sys.argv) < 2:
log("Need a verb.")
sys.exit(1)
if sys.argv[1] == "run":
#start target app
setup_game_dir_drive()
Expand All @@ -1682,7 +1685,7 @@ if __name__ == "__main__":
path = subprocess.check_output([g_proton.wine_bin, "winepath", sys.argv[2]], env=g_session.env, stderr=g_session.log_file)
sys.stdout.buffer.write(path)
else:
log("Need a verb.")
log("Bad verb.")
sys.exit(1)

sys.exit(rc)
Expand Down