You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LeafletEditor.remove() crashes if no edits were made #888
`LeafletEditor.remove()` calls `self.saveButton.remove()` unconditionally, but `self.saveButton` is only created when `_showSaveButton()` is called (i.e., after the user creates, edits, or deletes a feature). If `remove()` is called before any edits were made, it crashes with `TypeError: Cannot read properties of undefined (reading 'remove')`.
Steps to reproduce
Initialize the LeafletEditor on a GeoJSON page
Call `editor.remove()` without making any edits
Expected behavior
`remove()` should clean up gracefully regardless of whether edits were made.
Actual behavior
`TypeError: Cannot read properties of undefined (reading 'remove')` — the draw controls and GeoJSON layer are never cleaned up because the error occurs before `self.geoJsonLayer.remove()`.
Activity