Skip to content

Commit

Permalink
Add nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
xackery committed Dec 19, 2023
1 parent 8e18e71 commit 8f5708d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion peqeditorsql/tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ func newTailWatch(rootCtx context.Context, req *tailReq, msgChan chan string) (*

func (e *tailWatch) restart(msgChan chan string) error {
var err error
e.cancel()
if e.cancel != nil {
e.cancel()
}
time.Sleep(1 * time.Second)
e.ctx, e.cancel = context.WithCancel(context.Background())
buf := new(bytes.Buffer)
Expand Down

0 comments on commit 8f5708d

Please sign in to comment.