From ff11f7f3d3ff2c3d8773a0626fa053da8f7c84f9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 22 May 2018 08:14:13 +0200 Subject: [PATCH] Improved error handling of of invalid setting attributes. --- .../javascripts/app/controllers/_settings/area_item.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/assets/javascripts/app/controllers/_settings/area_item.coffee b/app/assets/javascripts/app/controllers/_settings/area_item.coffee index 877caeee0..f268f01e4 100644 --- a/app/assets/javascripts/app/controllers/_settings/area_item.coffee +++ b/app/assets/javascripts/app/controllers/_settings/area_item.coffee @@ -9,6 +9,13 @@ class App.SettingsAreaItem extends App.Controller render: => + # input validation for error handling + if !@setting.options + throw "No such options for #{@setting.name}" + + if !@setting.options.form + throw "No such options.form for #{@setting.name}" + # defaults directValue = 0 for item in @setting.options['form']