From 4eac4542e83328a4d5dddc73d5cace42427fae22 Mon Sep 17 00:00:00 2001 From: Pragati Agrawal Date: Thu, 7 May 2020 17:00:24 +0530 Subject: [PATCH] org settings: Return `undefined` in get_input_element_value. This change makes `.get_input_element_value()` return a `undefined` instead of `null` when `input_type` is not defined. Which also make sense logically, as > null: absence of value for a variable; > undefined: absence of variable itself; Source: https://stackoverflow.com/q/5076944/7418550 --- static/js/settings_org.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/settings_org.js b/static/js/settings_org.js index 546f33cc84..b0dbfe0911 100644 --- a/static/js/settings_org.js +++ b/static/js/settings_org.js @@ -461,7 +461,7 @@ exports.get_input_element_value = function (input_elem) { return parseInt(input_elem.val().trim(), 10); } } - return null; + return; }; exports.set_up = function () { @@ -750,7 +750,7 @@ exports.build_page = function () { input_elem = $(input_elem); if (check_property_changed(input_elem)) { const input_value = exports.get_input_element_value(input_elem); - if (input_value !== null) { + if (input_value !== undefined) { const property_name = input_elem.attr('id').replace("id_realm_", ""); data[property_name] = JSON.stringify(input_value); }