Looks like the 'who' packet doesn't have a target element in the target@destination segment of the packet. Handle this semi-intelligently when ran into.

This commit is contained in:
Greg Taylor 2009-04-13 04:38:05 +00:00
parent 859166a41c
commit 317a4f1532

View file

@ -74,7 +74,14 @@ class IMC2Packet(object):
target_destination = token
split_target_destination = target_destination.split('@')
self.target = split_target_destination[0]
self.destination = split_target_destination[1]
try:
self.destination = split_target_destination[1]
except IndexError:
# There is only one element to the target@dest segment
# of the packet. Wipe the target and move the captured
# value to the destination attrib.
self.target = '*'
self.destination = split_target_destination[0]
elif counter > 4:
# Populate optional data.
key, value = token.split('=', 1)