From 9650ae62416edb3c5fb985697f5ab33e9609ecf8 Mon Sep 17 00:00:00 2001 From: Andrew Stevens Date: Thu, 24 Jan 2013 13:09:55 -0600 Subject: [PATCH] ad nil check --- lib/authenticom_rpa.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/authenticom_rpa.rb b/lib/authenticom_rpa.rb index 6a071d1..3bfc1e0 100644 --- a/lib/authenticom_rpa.rb +++ b/lib/authenticom_rpa.rb @@ -35,7 +35,11 @@ def lookup(phone_number, options = {}) } ) - response.body[:find_info3_response][:find_info3_result][:match] + if response.body[:find_info3_response] && response.body[:find_info3_response][:find_info3_result] && response.body[:find_info3_response][:find_info3_result][:match] + response.body[:find_info3_response][:find_info3_result][:match] + else + nil + end end end end