From a58a281d3a851399f491db2f8815917ea6f46d68 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Wed, 29 May 2019 16:01:30 -0700 Subject: [PATCH] Improve Gathering error handling Gather only asserted that it wasn't GatheringStateGathering. This meant that if gathering was complete it would allow multiple runs. --- gather.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gather.go b/gather.go index f6ea9fc..ea4f15c 100644 --- a/gather.go +++ b/gather.go @@ -97,7 +97,7 @@ func (a *Agent) GatherCandidates() error { gatherErrChan := make(chan error, 1) runErr := a.run(func(agent *Agent) { - if a.gatheringState == GatheringStateGathering { + if a.gatheringState != GatheringStateNew { gatherErrChan <- ErrMultipleGatherAttempted return } else if a.onCandidateHdlr == nil {