diff --git a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb index 1fa4f22a6..a952568c4 100644 --- a/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb +++ b/api/lib/mno_enterprise/concerns/controllers/pages_controller.rb @@ -59,9 +59,14 @@ def app_logout def terms @meta[:title] = 'Terms of Use' @meta[:description] = 'Terms of Use' - ts = MnoEnterprise::App.order_by("updated_at.desc").first.updated_at - @apps = Rails.cache.fetch(['pages/terms/app-list', ts]) do - MnoEnterprise::App.order_by("name.ac").reject{|i| i.terms_url.blank?} + + ts = MnoEnterprise::App.order_by("updated_at.desc").first.try(:updated_at) + @apps = if ts + Rails.cache.fetch(['pages/terms/app-list', ts]) do + MnoEnterprise::App.order_by("name.ac").reject{|i| i.terms_url.blank?} + end + else + [] end end