handled None in screenshot.create()

This commit is contained in:
Femi Lawal 2024-03-11 09:10:09 +01:00
parent 270abc5167
commit a16474f613

View File

@ -36,6 +36,12 @@ def init():
Finds the game window, and calculates the offset to remove the title bar
"""
WindowServer.sslib = screenshot.create()
# Check if the screenshot library was successfully created
if WindowServer.sslib is None:
logging.error("Failed to create screenshot library instance")
WindowServer.status = Status.CRASHED
return
WindowServer.status = Status.RUNNING
WindowServer.crop = os_services.get_game_window_rect()