Skip to content

Commit 0666afe

Browse files
committed
💂‍♂️ Add guard when creating binding without a minimap
Should prevent errors reported in #17
1 parent c8acb71 commit 0666afe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/minimap-git-diff-binding.coffee

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ class MinimapGitDiffBinding
77
active: false
88

99
constructor: (@minimap) ->
10-
@editor = @minimap.getTextEditor()
1110
@decorations = {}
1211
@markers = null
1312
@subscriptions = new CompositeDisposable
1413

14+
unless @minimap?
15+
return console.warn 'minimap-git-diff binding created without a minimap'
16+
17+
@editor = @minimap.getTextEditor()
18+
1519
@subscriptions.add @editor.getBuffer().onDidStopChanging @updateDiffs
1620
@subscriptions.add @minimap.onDidDestroy @destroy
1721

0 commit comments

Comments
 (0)