Topic.reorder: Fixed some bugs found via jemfinch's new tests

This commit is contained in:
James Vega 2003-12-09 14:51:04 +00:00
parent 88581d99e4
commit 05238bfcc6

View File

@ -150,6 +150,9 @@ class Topic(callbacks.Privmsg, configurable.Mixin):
except ValueError: except ValueError:
irc.error(msg, 'The positions must be valid integers.') irc.error(msg, 'The positions must be valid integers.')
return return
if utils.sorted(order) != range(num):
irc.error(msg, 'All topic numbers must be specified uniquely')
return
try: try:
newtopics = [topics[i] for i in order] newtopics = [topics[i] for i in order]
newtopic = self._joinTopic(newtopics, channel) newtopic = self._joinTopic(newtopics, channel)