Fix: init indexedFeatureStore with a default map as to fix crash upon loading if a pending change is present

This commit is contained in:
Pieter Vander Vennet 2023-05-05 00:59:43 +02:00
parent cbb0c9c1d7
commit 377c411143

View file

@ -16,7 +16,7 @@ export default class FeatureSourceMerger implements IndexedFeatureSource {
* In case that multiple features have the same id, the latest `_version_number` will be used. Otherwise, we will take the last one * In case that multiple features have the same id, the latest `_version_number` will be used. Otherwise, we will take the last one
*/ */
constructor(...sources: FeatureSource[]) { constructor(...sources: FeatureSource[]) {
this._featuresById = new UIEventSource<Map<string, Feature>>(undefined) this._featuresById = new UIEventSource<Map<string, Feature>>(new Map<string, Feature>())
this.featuresById = this._featuresById this.featuresById = this._featuresById
const self = this const self = this
sources = Utils.NoNull(sources) sources = Utils.NoNull(sources)