Skip to content

Commit

Permalink
protect from no text
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Nov 28, 2023
1 parent 9e0f91b commit a04f3db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ofscraper/utils/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def post_user_filter(media):
if not userfilter:
return media
elif not userfilter.islower():
return list(filter(lambda x:re.search(userfilter,x.text)!=None,media))
return list(filter(lambda x:re.search(userfilter,x.text or "")!=None,media))
else:
return list(filter(lambda x:re.search(userfilter,x.text ,re.IGNORECASE)!=None,media))
return list(filter(lambda x:re.search(userfilter,x.text or "",re.IGNORECASE)!=None,media))

def anti_post_user_filter(media):
userfilter=args_.getargs().neg_filter
Expand Down

0 comments on commit a04f3db

Please sign in to comment.