fix(seautils): catch an UnboundLocalError

This commit is contained in:
Seaswimmer 2024-05-17 00:14:33 -04:00
parent 5116598788
commit 7019b9ffe5
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -76,7 +76,7 @@ class SeaUtils(commands.Cog):
content.append(f"**Page {i}/{max_i}**\n{cf.box(page, lang='py')}") content.append(f"**Page {i}/{max_i}**\n{cf.box(page, lang='py')}")
i += 1 i += 1
await SimpleMenu(pages=content, disable_after_timeout=True, timeout=180).start(ctx) await SimpleMenu(pages=content, disable_after_timeout=True, timeout=180).start(ctx)
except (OSError, AttributeError): except (OSError, AttributeError, UnboundLocalError):
if ctx.embed_requested(): if ctx.embed_requested():
embed = Embed(title="Object not found!", color=await ctx.embed_color()) embed = Embed(title="Object not found!", color=await ctx.embed_color())
await ctx.send(embed=embed, reference=ctx.message.to_reference(fail_if_not_exists=False)) await ctx.send(embed=embed, reference=ctx.message.to_reference(fail_if_not_exists=False))