Permalink
Browse files

Merge pull request #27 from Keithbsmiley/data-fix

Make sure data exists before using it
  • Loading branch information...
2 parents a1cf828 + f5c0873 commit 9e13dc3399f7429713b5213c5ee77bedf01def31 @EmmanuelOga committed Jul 29, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/firering/requests.rb
View
@@ -27,7 +27,7 @@ def room(id, &callback)
# multi: if true, gets all the users from each room as Firering::User objects
def rooms(&callback)
http(:get, "/rooms.json") do |data, http|
- if data[:rooms]
+ if data && data[:rooms]
callback.call(data[:rooms].map{|room| Firering::Room.instantiate(self, room)}) if callback
else
logger.error(http.response)

0 comments on commit 9e13dc3

Please sign in to comment.