Skip to content

Commit

Permalink
[completer] Fix bug which causes integer divide by zero panicking whe…
Browse files Browse the repository at this point in the history
…n input buffer is empty (chzyer#54)

* [completer] Fixes issue chzyer#53

* Changing check to candidateSource
  • Loading branch information
antekresic authored and lunixbochs committed May 4, 2017
1 parent 3a84b4f commit f07e46d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion complete.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (o *opCompleter) OnComplete() {
buf := o.op.buf
rs := buf.Runes()

if o.IsInCompleteMode() && runes.Equal(rs, o.candidateSource) {
if o.IsInCompleteMode() && o.candidateSource != nil && runes.Equal(rs, o.candidateSource) {
o.EnterCompleteSelectMode()
o.doSelect()
return
Expand Down

0 comments on commit f07e46d

Please sign in to comment.