Skip to content

Commit

Permalink
unicode_info: fallback if input is None (#958)
Browse files Browse the repository at this point in the history
Resolves #957
  • Loading branch information
dgw authored and maxpowa committed Jun 22, 2016
1 parent 274af02 commit 335a564
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sopel/modules/unicode_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
@example('.u ‽', 'U+203D INTERROBANG (‽)')
@example('.u 203D', 'U+203D INTERROBANG (‽)')
def codepoint(bot, trigger):
arg = trigger.group(2).strip()
if len(arg) == 0:
arg = trigger.group(2)
if not arg:
bot.reply('What code point do you want me to look up?')
return NOLIMIT
elif len(arg) > 1:
stripped = arg.strip()
if len(stripped) > 0:
arg = stripped
if len(arg) > 1:
if arg.startswith('U+'):
arg = arg[2:]
try:
Expand Down

0 comments on commit 335a564

Please sign in to comment.