Explicitly guard against decorating destroyed markers

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Max Brunsfeld
2016-01-11 14:01:55 -08:00
committed by Nathan Sobo
parent c02d7995ce
commit b01e97be59
2 changed files with 8 additions and 0 deletions

View File

@@ -812,6 +812,7 @@ class DisplayBuffer extends Model
decorationsState
decorateMarker: (marker, decorationParams) ->
throw new Error("Cannot decorate a destroyed marker") if marker.isDestroyed()
marker = @getMarkerLayer(marker.layer.id).getMarker(marker.id)
decoration = new Decoration(marker, this, decorationParams)
@decorationsByMarkerId[marker.id] ?= []