ssimunic / Daily-Reddit-Wallpaper

Change your wallpaper to the most upvoted image of the day from /r/wallpapers or any other subreddit on system startup
http://ssimunic.github.io/Daily-Reddit-Wallpaper/
GNU General Public License v3.0
306 stars 51 forks source link

Fails If Image Not Found #25

Open everythingfunctional opened 8 years ago

everythingfunctional commented 8 years ago

At lines 169-170, if a suitable image isn't found, the script crashes, since nothing is returned from the get_top_image function in that case. Here's the error message:

Traceback (most recent call last):
  File "./change_wallpaper_reddit.py", line 170, in <module>
    if "url" not in image:
TypeError: argument of type 'NoneType' is not iterable

It's causing problems when trying to change my background hourly with the --time hour option.