mirror of
https://github.com/nasa/openmct.git
synced 2025-01-20 03:36:44 +00:00
Checks for input before processing it.
This commit is contained in:
parent
39d7dc8372
commit
015aa8c637
@ -208,8 +208,11 @@ export const OPERATIONS = [
|
||||
{
|
||||
name: 'valueIs',
|
||||
operation: function (input) {
|
||||
const values = input[1].split(',');
|
||||
return values.find((value) => input[0].toString() === _.trim(value.toString()));
|
||||
if (input[1]) {
|
||||
const values = input[1].split(',');
|
||||
return values.find((value) => input[0].toString() === _.trim(value.toString()));
|
||||
}
|
||||
return false;
|
||||
},
|
||||
text: 'is one of',
|
||||
appliesTo: ["string", "number"],
|
||||
@ -221,9 +224,12 @@ export const OPERATIONS = [
|
||||
{
|
||||
name: 'valueIsNot',
|
||||
operation: function (input) {
|
||||
const values = input[1].split(',');
|
||||
const found = values.find((value) => input[0].toString() === _.trim(value.toString()));
|
||||
return !found;
|
||||
if (input[1]) {
|
||||
const values = input[1].split(',');
|
||||
const found = values.find((value) => input[0].toString() === _.trim(value.toString()));
|
||||
return !found;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
text: 'is not one of',
|
||||
appliesTo: ["string", "number"],
|
||||
|
Loading…
Reference in New Issue
Block a user