mirror of https://github.com/apache/superset.git
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:
parent
63ef649d1d
commit
cdd01f4851
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue