Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
Don't access WHOIS data before checking for failure
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikh committed Oct 23, 2015
1 parent 837c8cb commit 4d7e8cc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/cinch/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,16 @@ def whois
# @since 1.0.1
def end_of_whois(values)
@in_whois = false
if values.nil?
# for some reason, we did not receive user information. one
# reason is freenode throttling WHOIS
Thread.new do
sleep 2
refresh
end
return
end

if values[:unknown?]
sync(:unknown?, true, true)
self.online = false
Expand All @@ -293,16 +303,6 @@ def end_of_whois(values)
return
end

if values.nil?
# for some reason, we did not receive user information. one
# reason is freenode throttling WHOIS
Thread.new do
sleep 2
refresh
end
return
end

if values[:registered]
values[:authname] ||= self.nick
values.delete(:registered)
Expand Down

0 comments on commit 4d7e8cc

Please sign in to comment.