misc: configurator: Fix vUART and IVSHMEM select box missing problem

When user adds a vUART or IVSHMEM region and select VMs in selection
list, deleting the selected VM could break the selection box.

This patch adds a state check against null and undefined value.

Tracked-On: #7624
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
Yifan Liu 2022-05-30 10:54:27 +08:00 committed by acrnsi-robot
parent 5ad5213aeb
commit 8042806676
2 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ export default {
},
methods: {
validation(value) {
return value.length != 0;
return (value != null) && (value.length != 0);
},
addSharedVM(vms, index) {
// add new item after current item

View File

@ -168,7 +168,7 @@ export default {
},
methods: {
validation(value) {
return value.length != 0;
return (value != null) && (value.length != 0);
},
removeVUARTConnection(index) {
this.defaultVal.splice(index, 1);