diff --git a/modules/line_handler/channel.py b/modules/line_handler/channel.py index 0feedf74..ad8edf71 100644 --- a/modules/line_handler/channel.py +++ b/modules/line_handler/channel.py @@ -113,11 +113,12 @@ def part(events, event): server=event["server"]) def handle_324(event): - channel = event["server"].channels.get(event["args"][1]) - modes = event["args"][2] - for mode in modes[1:]: - if mode in event["server"].channel_modes: - channel.add_mode(mode) + if event["args"][1] in event["server"].channels: + channel = event["server"].channels.get(event["args"][1]) + modes = event["args"][2] + for mode in modes[1:]: + if mode in event["server"].channel_modes: + channel.add_mode(mode) def handle_329(event): channel = event["server"].channels.get(event["args"][1])