Skip to content

Commit

Permalink
fix(filterDefinition: preSelect.split needs to be nullsafe
Browse files Browse the repository at this point in the history
local_single hasa preSelect as null and therefore throws an error here
Introduced here: #194
  • Loading branch information
MercuryKojo authored Oct 10, 2024
1 parent 0a01431 commit 6b59d83
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ pimcore.object.tags.indexFieldSelection = Class.create(pimcore.object.tags.selec
load: function(store) {
if(this.data) {
if(this.preSelectCombobox.rendered) {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.data.preSelect?.split(',').map(Number));
} else {
this.preSelectCombobox.addListener("afterRender", function() {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.data.preSelect?.split(',').map(Number));
}.bind(this));
}
}
Expand Down Expand Up @@ -239,10 +239,10 @@ pimcore.object.tags.indexFieldSelection = Class.create(pimcore.object.tags.selec

if(this.fieldConfig.multiPreSelect == 'local_single' || this.fieldConfig.multiPreSelect == 'local_multi') {
if(this.preSelectCombobox.rendered) {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.data.preSelect?.split(',').map(Number));
} else {
this.preSelectCombobox.addListener("afterRender", function() {
this.preSelectCombobox.setValue(this.data.preSelect.split(',').map(Number));
this.preSelectCombobox.setValue(this.data.preSelect?.split(',').map(Number));
}.bind(this));
}
}
Expand Down

0 comments on commit 6b59d83

Please sign in to comment.