From 9775af5e980539a01d5e1b37b2352c6cf6e1852e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 20 May 2019 11:22:36 +0200 Subject: [PATCH] Improved error handling if proposed calendar is not valid. --- app/models/calendar.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/calendar.rb b/app/models/calendar.rb index 7b2ce7f7d..80039df32 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -38,7 +38,9 @@ returns calendar object # call for calendar suggestion calendar_details = Service::GeoCalendar.location(ip) - return if !calendar_details + return if calendar_details.blank? + return if calendar_details['name'].blank? + return if calendar_details['business_hours'].blank? calendar_details['name'] = Calendar.generate_uniq_name(calendar_details['name']) calendar_details['default'] = true