Skip to content

Commit

Permalink
Improved error handling if proposed calendar is not valid.
Browse files Browse the repository at this point in the history
  • Loading branch information
znuny-robo committed May 20, 2019
1 parent 6ae6ee4 commit 9775af5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/calendar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ def self.init_setup(ip = nil)

# 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
Expand Down

0 comments on commit 9775af5

Please sign in to comment.