Skip to content

Commit

Permalink
Handle bad base64 don't exception
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Dec 4, 2019
1 parent bb125a6 commit 84e903e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion viringo/catalogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ def set_to_search_query(unparsed_set):

if unparsed_set and "~" in unparsed_set:
_, search_query_base64 = unparsed_set.split("~")
return base64.urlsafe_b64decode(search_query_base64).decode("utf-8")
try:
base64.urlsafe_b64decode(search_query_base64).decode("utf-8")
except:
return None

return None

Expand Down

0 comments on commit 84e903e

Please sign in to comment.