diff --git a/files/helpers/useractions.py b/files/helpers/useractions.py index 58707f320..1780aca8c 100644 --- a/files/helpers/useractions.py +++ b/files/helpers/useractions.py @@ -8,10 +8,10 @@ def badge_grant(user, badge_id, description=None, url=None, notify=True): if user.has_badge(badge_id): return - if len(description) > 256: + if description and len(description) > 256: abort(400, "Custom description is too long, max 256 characters!") - if len(url) > 256: + if url and len(url) > 256: abort(400, "URL is too long, max 256 characters!") badge = Badge(