Fix possible crash

Thanks to - http://forum.xchat.org/viewtopic.php?f=5&t=7558