Skip to content

Commit

Permalink
[reddit] prevent exception with empty submission URLs (#2913)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Sep 14, 2022
1 parent 464ea90 commit 35eddaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gallery_dl/extractor/reddit.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def items(self):
submission["created_utc"])
yield Message.Directory, submission
visited.add(submission["id"])
url = submission["url"]
submission["num"] = 0

if url.startswith("https://i.redd.it/"):
url = submission["url"]
if url and url.startswith("https://i.redd.it/"):
text.nameext_from_url(url, submission)
yield Message.Url, url, submission

Expand Down

0 comments on commit 35eddaa

Please sign in to comment.