mirror of
https://github.com/lutris/lutris
synced 2024-09-04 23:13:35 +00:00
Prevent crash when generating script of a game with no runner
This commit is contained in:
parent
a17b6fbf54
commit
4ed658727e
|
@ -389,6 +389,9 @@ class Game(GObject.Object):
|
|||
"""Return the information provided by a runner's play method.
|
||||
Checks for possible errors.
|
||||
"""
|
||||
if not self.runner:
|
||||
logger.warning("Trying to launch %s without a runner", self)
|
||||
return {}
|
||||
gameplay_info = self.runner.play()
|
||||
if "error" in gameplay_info:
|
||||
self.show_error_message(gameplay_info)
|
||||
|
@ -669,6 +672,7 @@ class Game(GObject.Object):
|
|||
"""Output the launch argument in a bash script"""
|
||||
gameplay_info = self.get_gameplay_info()
|
||||
if not gameplay_info:
|
||||
logger.error("Unable to retrieve game information for %s. Can't write a script", self)
|
||||
return
|
||||
export_bash_script(self.runner, gameplay_info, script_path)
|
||||
|
||||
|
|
Loading…
Reference in a new issue