From 11dc1567646feed73d908d293cd0fcba4c6224bb Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Sun, 5 May 2013 09:40:51 +0200 Subject: routes can be nil --- app/models/phone_number.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/phone_number.rb b/app/models/phone_number.rb index 919b703..4b22f40 100644 --- a/app/models/phone_number.rb +++ b/app/models/phone_number.rb @@ -240,7 +240,9 @@ class PhoneNumber < ActiveRecord::Base 'caller.account_uuid' => account.try(:uuid), }) - return routes['routes']['1'] + if routes + return routes['routes']['1'] + end end # Find the (grand-)parent tenant of this phone number: -- cgit v1.2.3