From da5bf6c74cc17432e64346af5102cb09cfac0a83 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Thu, 5 Jun 2014 18:12:36 -0700 Subject: [PATCH] Defensive on the decorations --- src/gutter-component.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gutter-component.coffee b/src/gutter-component.coffee index 5dff8609d..822d43393 100644 --- a/src/gutter-component.coffee +++ b/src/gutter-component.coffee @@ -162,9 +162,10 @@ GutterComponent = React.createClass for decoration in previousDecorations node.classList.remove(decoration.class) if not contains(decorations, decoration) - for decoration in decorations - if not contains(previousDecorations, decoration) and (not softWrapped or softWrapped and decoration.softWrap) - node.classList.add(decoration.class) + if decorations? + for decoration in decorations + if not contains(previousDecorations, decoration) and (not softWrapped or softWrapped and decoration.softWrap) + node.classList.add(decoration.class) unless @screenRowsByLineNumberId[lineNumberId] is screenRow {lineHeightInPixels} = @props