From a8e21c277e308f6b1de44bac0da39ee4f04f0618 Mon Sep 17 00:00:00 2001 From: abe33 Date: Wed, 3 Dec 2014 12:59:10 +0100 Subject: [PATCH] :bug: Prevent removal of inexistant decorations --- lib/mixins/decoration-management.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mixins/decoration-management.coffee b/lib/mixins/decoration-management.coffee index 39e01ec7..84bff619 100644 --- a/lib/mixins/decoration-management.coffee +++ b/lib/mixins/decoration-management.coffee @@ -190,7 +190,8 @@ class DecorationManagement extends Mixin # marker - The `marker` for which removing decorations. removeAllDecorationsForMarker: (marker) -> return unless marker? - decorations = @decorationsByMarkerId[marker.id].slice() + decorations = @decorationsByMarkerId[marker.id]?.slice() + return unless decorations for decoration in decorations @emitter.emit 'did-remove-decoration', {marker, decoration} @stackDecorationChanges(decoration)