Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jtyliu committed Mar 12, 2022
1 parent 0cfb944 commit 5f1a4d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extensions/handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,12 @@ async def link(ctx: lightbulb.Context) -> None:
username = ctx.options.username
# Check if user exists
query = Query()
user = await query.get_user(username)
try:
user = await query.get_user(username)

if user is None:
if user is None:
raise ObjectNotFound()
except ObjectNotFound:
await ctx.respond(escape_markdown(f"{username} does not exist on DMOJ"))
return

Expand Down

0 comments on commit 5f1a4d4

Please sign in to comment.