cinchrb / cinch

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

Fix hooks disappearing mysteriously #211

Closed petertseng closed 8 years ago

petertseng commented 8 years ago

In the code path through __hooks where type and events are both non-nil, hooks is a value in the @hooks instance variable, and calling #select! on it modifies the array inside @hooks as well.

This was causing hooks to mysteriously disappear when hooks had disjoint event types.

Use #select instead.

dominikh commented 8 years ago

Merged as c8ed88bec15f0afa09c8198dd5b9d560f2094137, thank you.