Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix for crash when ~/.cache/wal was empty #669

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pywal/wallpaper.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ def get(cache_dir=CACHE_DIR):
current_wall = os.path.join(cache_dir, "wal")

if os.path.isfile(current_wall):
return util.read_file(current_wall)[0]
# make sure the file has some content in it,
contents = util.read_file(current_wall)

if len(contents) > 0:
return contents [0]

return "None"