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

Fix program crashing because it tries to process a NoneType #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fluffeon
Copy link

@fluffeon fluffeon commented Jul 19, 2024

Fixes:

Traceback (most recent call last):
  File "/usr/local/bin/komorebi", line 160, in <module>
    main()
  File "/usr/local/bin/komorebi", line 150, in main
    screen.load_wallpaper(Settings.wallpaper_name)
  File "/usr/local/lib/python3.12/site-packages/komorebi/screen.py", line 162, in load_wallpaper
    overlays = komorebi.utilities.load_overlays(self, wallpaper_info)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/komorebi/utilities.py", line 131, in load_overlays
    overlays.append(Desktop(screen))
                    ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/komorebi/overlays/desktop.py", line 497, in __init__
    self.get_desktops()
  File "/usr/local/lib/python3.12/site-packages/komorebi/overlays/desktop.py", line 638, in get_desktops
    self.grab_desktop_paths()
  File "/usr/local/lib/python3.12/site-packages/komorebi/overlays/desktop.py", line 681, in grab_desktop_paths
    icon = ApplicationIcon(name, icon_pixbuf, desktop_file.get_path(), command, self.icon_size)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/komorebi/overlays/desktop.py", line 285, in __init__
    Icon.__init__(self, name, pixbuf, icon_size)
  File "/usr/local/lib/python3.12/site-packages/komorebi/overlays/desktop.py", line 163, in __init__
    self.icon_image.set_data(pixbuf.get_pixels(),
                             ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_pixels'

feel free to find a better solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant