Skip to content

Commit

Permalink
Handle null result sets more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Apr 21, 2010
1 parent ef91557 commit f6d1f99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/twitter/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ def fetch(force=false)
end

def each
fetch()["results"].each{|r| yield r}
results = fetch()['results']
return if results.nil?
results.each {|r| yield r}
end

def next_page?
Expand Down

0 comments on commit f6d1f99

Please sign in to comment.