Properly insert at the end if position is not found when moving.

Fixes #5923
This commit is contained in:
Rapptz 2020-10-17 01:52:35 -04:00
parent d9acc2f491
commit b9e1bdf87e

View File

@ -227,7 +227,7 @@ class GuildChannel:
# not there somehow lol
return
else:
index = next((i for i, c in enumerate(channels) if c.position >= position), -1)
index = next((i for i, c in enumerate(channels) if c.position >= position), len(channels))
# add ourselves at our designated position
channels.insert(index, self)