Just-Jojo / JojoCogs

Cogs I have written/rewritten for V3 of Red - Discord Bot
MIT License
14 stars 12 forks source link

[todo] Getting NoneType iterable error upon loading the cog #82

Closed cool-aid-man closed 1 year ago

cool-aid-man commented 1 year ago

Cog

ToDo

Details

Getting 'NoneType' object is not iterable error upon loading the cog on red 3.5 & dpy2

Discord User Information

Cool aid man#3600

Traceback details (if applicable)

Exception during loading of package
Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/redbot/core/core_commands.py", line 188, in _load
    await bot.load_extension(spec)
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/redbot/core/bot.py", line 1686, in load_extension
    await lib.setup(self)
  File "/home/ubuntu/data/starship_main/cogs/CogManager/cogs/todo/__init__.py", line 13, in setup
    await bot.add_cog(ToDo(bot))
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/redbot/core/bot.py", line 1907, in add_cog
    await super().add_cog(cog, guild=guild, guilds=guilds)
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 783, in add_cog
    cog = await cog._inject(self, override=override, guild=guild, guilds=guilds)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/discord/ext/commands/cog.py", line 682, in _inject
    await maybe_coroutine(self.cog_load)
  File "/home/ubuntu/redenv/lib/python3.11/site-packages/discord/utils.py", line 688, in maybe_coroutine
    return await value
           ^^^^^^^^^^^
  File "/home/ubuntu/data/starship_main/cogs/CogManager/cogs/todo/core.py", line 112, in cog_load
    for todo in data["todos"]:
TypeError: 'NoneType' object is not iterable

Reproduction

update > load the cog

Just-Jojo commented 1 year ago

Hey, thanks for letting me know about this. This should be fixed with the latest update of ToDo

cool-aid-man commented 1 year ago

Hii Jojo Yes the issue is resolved and cog can get loaded with the latest update.

Although I noticed another thing: When you do <p>todo list and try to navigate with buttons (to go through with different pages of todos), it work but at the same time it fails the interaction. So, todo list > navigate with buttons > it takes you to the next page > int failed