Permalink
Browse files

don't fail on nil data from a locked room

  • Loading branch information...
1 parent c76a1f6 commit 5bddebaae5b8eb927fe7611f891834a0fbb5eedb Emmanuel Oga committed Aug 16, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/firering/data/room.rb
@@ -16,8 +16,8 @@ def stream(&callback)
# 2) we make sure the users are here even if the room was instantiated from a
# /rooms request
def users(&callback)
- connection.http(:get, "/room/#{id}.json") do |data, http|
- callback.call(data[:room][:users].map { |user| Firering::User.instantiate(self, user) }) if callback
+ connection.http(:get, "/room/#{id}.json") do |data, http| # data can be blank on locked rooms
+ callback.call(data ? data[:room][:users].map { |user| Firering::User.instantiate(self, user) } : Array.new) if callback
end
end

0 comments on commit 5bddeba

Please sign in to comment.