Permalink
Browse files

Prevent whois on non-existent nicks from crashing (closes #116)

  • Loading branch information...
1 parent 1356b4d commit b8298f2a7c3537cd26bb8d4ab46bd07998468353 @martynsmith committed Nov 3, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/irc.js
View
@@ -806,6 +806,8 @@ Client.prototype._addWhoisData = function(nick, key, value, onlyIfExists) { // {
this._whoisData[nick][key] = value;
} // }}}
Client.prototype._clearWhoisData = function(nick) { // {{{
+ // Ensure that at least the nick exists before trying to return
+ this._addWhoisData(nick, 'nick', nick);
var data = this._whoisData[nick];
delete this._whoisData[nick];
return data;

0 comments on commit b8298f2

Please sign in to comment.