Skip to content

Commit

Permalink
check if function exists before binding
Browse files Browse the repository at this point in the history
  • Loading branch information
simonseyock committed May 27, 2021
1 parent e2db798 commit f3b8fca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/data/store/Layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ Ext.define('GeoExt.data.store.Layers', {
*/
onChangeLayer: function(evt) {
var layer = evt.target;
var record = this.getByLayer(layer,
this.changeLayerFilterFn.bind(layer));
var filter = this.changeLayerFilterFn ?
this.changeLayerFilterFn.bind(layer) : undefined;
var record = this.getByLayer(layer, filter);

if (record !== undefined) {
if (evt.key === 'description') {
Expand Down

0 comments on commit f3b8fca

Please sign in to comment.