From 43e6a14378c3f36a8fab81d1fa234830d50fd23d Mon Sep 17 00:00:00 2001 From: Godwin Date: Fri, 16 Sep 2016 04:36:27 -0700 Subject: [PATCH] Fixed error matching housing availability --- app/helpers/application_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5b860f7..bbbe0d8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1158,6 +1158,7 @@ module ApplicationHelper end def available_dates_match?(host, guest) + return false unless host.housing_data['availability'].present? && host.housing_data['availability'][1].present? if host.housing_data['availability'][0] <= guest.arrival && host.housing_data['availability'][1] >= guest.departure return true