File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 11### 0.15.1 (Next)
22
33* Your contribution here.
4+ * [ #336 ] ( https://github.com/slack-ruby/slack-ruby-client/pull/336 ) : Fix: handle nil events - [ @pyama86 ] ( https://github.com/pyama86 ) .
45
56### 0.15.0 (2020/7/26)
67
Original file line number Diff line number Diff line change @@ -251,6 +251,8 @@ def dispatch(event)
251251 end
252252
253253 def run_handlers ( type , data )
254+ return unless store . class . events
255+
254256 handlers = store . class . events [ type . to_s ]
255257 handlers &.each do |handler |
256258 store . instance_exec ( data , &handler )
Original file line number Diff line number Diff line change 166166 expect ( client . store . team . name ) . to eq 'New Team Name Inc.'
167167 end
168168 end
169+
170+ describe '#run_handlers' do
171+ describe 'empty events' do
172+ before do
173+ @e = client . store . class . events
174+ client . store . class . events = nil
175+ end
176+
177+ after do
178+ client . store . class . events = @e
179+ end
180+
181+ it 'returns false when event is nil' do
182+ expect ( client . send ( :run_handlers , 'example' , { } ) ) . to be nil
183+ end
184+ end
185+ end
169186 end
170187
171188 describe '#start_async' do
You can’t perform that action at this time.
0 commit comments