Skip to content

Commit 20d6695

Browse files
authored
Update gamebro-gui.py
1 parent 4499d9a commit 20d6695

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gamebro-gui.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@
4242
# Create window
4343
screen = pygame.display.set_mode((WIDTH, HEIGHT))
4444
pygame.display.set_caption("Gamebro Studio")
45-
pygame.display.set_icon(pygame.image.load(iconpath := os.path.join('assets', 'icon.png')))
45+
try:
46+
pygame.display.set_icon(pygame.image.load(iconpath := os.path.join('assets', 'icon.png')))
47+
except (pygame.error, FileNotFoundError):
48+
print(f"Error loading icon. Ensure the file exists.")
49+
sys.exit()
4650
try:
4751
icon = PhotoImage(file=iconpath)
4852
except _tkinter.TclError:

0 commit comments

Comments
 (0)