cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

User.unmonitor() causes error if User.monitor() not previously called #95

Closed blowback closed 12 years ago

blowback commented 12 years ago

Speculatively calling User.unmonitor() causes an error if we haven't called User.monitor() for that user:

lib/cinch/user.rb:392:in `unmonitor': undefined method `stop' for nil:NilClass (NoMethodError)

I have enclosed the guts of User.unmonitor() in a conditional as a workaround:

def unmonitor
    if monitored
        ...
    end
end

It is convenient to be able to speculatively call unmonitor() without calling monitored() first.

dominikh commented 12 years ago

Good catch. Closed by 6de010e which got commited to both the maint and master branch.