Skip to content

Commit

Permalink
Added protections for null parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
onewheelskyward committed Jun 9, 2016
1 parent 3b0eeca commit fb87560
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/onewheel-google.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

class OnewheelGoogle
def self.search(query, cse_id, api_key, safe_search, image = false)
if query.empty?
if query.to_s.empty?
puts 'Query blank, cannot continue.'
return
end

if cse_id.empty?
if cse_id.to_s.empty?
puts 'CSE_id blank, cannot continue.'
return
end

if api_key.empty?
if api_key.to_s.empty?
puts 'api_key blank, cannot continue.'
return
end

if safe_search.empty?
if safe_search.to_s.empty?
puts 'safe_search blank, cannot continue.'
return
end
Expand Down
2 changes: 1 addition & 1 deletion onewheel-google.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = 'onewheel-google'
spec.version = '1.0.0'
spec.version = '1.0.1'
spec.authors = ['Andrew Kreps']
spec.email = ['andrew.kreps@gmail.com']
spec.description = 'An interface of Google Custom Search Engine for searching.'
Expand Down

0 comments on commit fb87560

Please sign in to comment.