From fb87560a766325ccbb8ac60d20195f3630d23be7 Mon Sep 17 00:00:00 2001 From: Andrew Kreps Date: Thu, 9 Jun 2016 10:34:20 -0700 Subject: [PATCH] Added protections for null parameters. --- lib/onewheel-google.rb | 8 ++++---- onewheel-google.gemspec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/onewheel-google.rb b/lib/onewheel-google.rb index 3ff42f0..d5f6602 100644 --- a/lib/onewheel-google.rb +++ b/lib/onewheel-google.rb @@ -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 diff --git a/onewheel-google.gemspec b/onewheel-google.gemspec index ae7689a..9c5e3eb 100644 --- a/onewheel-google.gemspec +++ b/onewheel-google.gemspec @@ -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.'