Permalink
Browse files

Fixes to return zero when first time error

  • Loading branch information...
1 parent 5732e58 commit d9fd2b96a350ffd70b31a8a4499d082893b3d6a7 @tosik committed Apr 5, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/ikioi/checker.rb
View
@@ -14,7 +14,9 @@ def initialize(keyword, board_name)
def fetch
@last_ikioi = parse(fetch_jsonp).find {|item| item['title'].include?(keyword) }['ikioi']
rescue OpenURI::HTTPError => e
- @last_ikioi
+ @last_ikioi || 0
+ rescue
+ 0
end
def parse(jsonp)

0 comments on commit d9fd2b9

Please sign in to comment.