Prevent error message link mentored in issue #948.

This commit is contained in:
Martin Edenhofer 2017-04-17 13:03:16 +02:00
parent a9b9cdc01d
commit e3065b1c51

View file

@ -12,8 +12,8 @@ class Sessions::Event::Broadcast < Sessions::Event::Base
# broadcast to recipient list
if @payload['recipient']
if @payload['recipient'].class != Hash
log 'error', "recipient attribute isn't a hash '#{@payload['recipient'].inspect}'"
if @payload['recipient'].class != Hash && @payload['recipient'].class != ActiveSupport::HashWithIndifferentAccess
log 'error', "recipient attribute isn't a hash (#{@payload['recipient'].class}) '#{@payload['recipient'].inspect}'"
elsif !@payload['recipient'].key?('user_id')
log 'error', "need recipient.user_id attribute '#{@payload['recipient'].inspect}'"
elsif @payload['recipient']['user_id'].class != Array