fix: Null error when deleting the last owner label in DatasourceEditor/settings (#11752)

* Fix null error when deleting the last owner in SelectAsyncControl

* Replace "||" with "??"
This commit is contained in:
Kamil Gabryjelski 2020-11-19 23:10:34 +01:00 committed by GitHub
parent 63ef649d1d
commit cdd01f4851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -60,11 +60,9 @@ const SelectAsyncControl = props => {
const onSelectionChange = options => {
let val;
if (multi) {
val = options.map(option => option.value);
} else if (options) {
val = options.value;
val = options?.map(option => option.value) ?? null;
} else {
val = null;
val = options?.value ?? null;
}
onChange(val);
};