Added null check

pull/2835/head
mertsincan 2022-08-02 10:44:25 +01:00
parent dcaec67475
commit 0ce3151e2d
4 changed files with 8 additions and 8 deletions

View File

@ -783,8 +783,8 @@ export default {
this.$emit('update:modelValue', value);
this.$emit('change', { originalEvent: event, value });
},
flatOptions(options = []) {
return options.reduce((result, option, index) => {
flatOptions(options) {
return (options || []).reduce((result, option, index) => {
result.push({ optionGroup: option, group: true, index });
const optionGroupChildren = this.getOptionGroupChildren(option);

View File

@ -771,8 +771,8 @@ export default {
this.$emit('update:modelValue', value);
this.$emit('change', { originalEvent: event, value });
},
flatOptions(options = []) {
return options.reduce((result, option, index) => {
flatOptions(options) {
return (options || []).reduce((result, option, index) => {
result.push({ optionGroup: option, group: true, index });
const optionGroupChildren = this.getOptionGroupChildren(option);

View File

@ -621,8 +621,8 @@ export default {
this.$emit('update:modelValue', value);
this.$emit('change', { originalEvent: event, value });
},
flatOptions(options = []) {
return options.reduce((result, option, index) => {
flatOptions(options) {
return (options || []).reduce((result, option, index) => {
result.push({ optionGroup: option, group: true, index });
const optionGroupChildren = this.getOptionGroupChildren(option);

View File

@ -901,8 +901,8 @@ export default {
this.$emit('update:modelValue', value);
this.$emit('change', { originalEvent: event, value });
},
flatOptions(options = []) {
return options.reduce((result, option, index) => {
flatOptions(options) {
return (options || []).reduce((result, option, index) => {
result.push({ optionGroup: option, group: true, index });
const optionGroupChildren = this.getOptionGroupChildren(option);