From f08047abb89b99d29d223fdf4a47088b44f965bb Mon Sep 17 00:00:00 2001 From: Alice <38675581+alice945@users.noreply.github.com> Date: Sat, 29 Jul 2023 00:56:59 +0000 Subject: [PATCH] proton: Fix a couple simple crashes --- proton | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proton b/proton index 11e5bab81..f4ccdc9eb 100755 --- a/proton +++ b/proton @@ -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", "") use_wined3d = "wined3d" in g_session.compat_config use_dxvk_dxgi = not use_wined3d and \ @@ -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() @@ -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)