diff --git a/recordset.go b/recordset.go index dabef304..f41d3f21 100644 --- a/recordset.go +++ b/recordset.go @@ -132,9 +132,9 @@ func (rcs *Recordset) signalEnd() { } func (rcs *Recordset) sendError(err error) { + rcs.chanLock.Lock() + defer rcs.chanLock.Unlock() if rcs.IsActive() { - rcs.chanLock.Lock() - defer rcs.chanLock.Unlock() rcs.Errors <- err } }