Skip to content

Commit

Permalink
Merge pull request #27 from Keithbsmiley/data-fix
Browse files Browse the repository at this point in the history
Make sure data exists before using it
  • Loading branch information
Emmanuel Oga committed Jul 29, 2014
2 parents a1cf828 + f5c0873 commit 9e13dc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/firering/requests.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 9e13dc3

Please sign in to comment.