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
This commit is contained in:
Pragati Agrawal 2020-05-07 17:00:24 +05:30 committed by Tim Abbott
parent 93b9f1ccfb
commit 4eac4542e8

View File

@ -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);
}