diff --git a/src/ol/interaction/Select.js b/src/ol/interaction/Select.js index aaaba63537..22f36f2e91 100644 --- a/src/ol/interaction/Select.js +++ b/src/ol/interaction/Select.js @@ -255,14 +255,11 @@ class Select extends Interaction { */ this.featureLayerAssociation_ = {}; - if (this.featureOverlay_) { - const features = this.featureOverlay_.getSource().getFeaturesCollection(); - listen(features, CollectionEventType.ADD, - this.addFeature_, this); - listen(features, CollectionEventType.REMOVE, - this.removeFeature_, this); - } - + const features = this.featureOverlay_.getSource().getFeaturesCollection(); + listen(features, CollectionEventType.ADD, + this.addFeature_, this); + listen(features, CollectionEventType.REMOVE, + this.removeFeature_, this); } /**