From 806843f4490e212043f7962735412c8b497ed4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sat, 30 Jul 2022 03:17:48 +0200 Subject: [PATCH] Don't fire remove event when Collection remains unchanged --- src/ol/Collection.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ol/Collection.js b/src/ol/Collection.js index 15c51f866b..5b562c05a5 100644 --- a/src/ol/Collection.js +++ b/src/ol/Collection.js @@ -254,6 +254,9 @@ class Collection extends BaseObject { * @api */ removeAt(index) { + if (index < 0 || index >= this.getLength()) { + return undefined; + } const prev = this.array_[index]; this.array_.splice(index, 1); this.updateLength_();