Merge pull request #18 from mattn/set-nil
Some checks failed
build cli / make-release (push) Has been cancelled
build cli / build-linux (push) Has been cancelled

set nil to ch
This commit is contained in:
mattn
2024-05-24 03:28:31 +09:00
committed by GitHub

View File

@@ -110,6 +110,7 @@ func (oss *OpensearchStorage) QueryEvents(ctx context.Context, filter nostr.Filt
ch <- evt
}
close(ch)
ch = nil
} else {
return nil, fmt.Errorf("error getting by id: %w", err)
}
@@ -152,7 +153,9 @@ func (oss *OpensearchStorage) QueryEvents(ctx context.Context, filter nostr.Filt
}
}
}
close(ch)
if ch != nil {
close(ch)
}
}()
return ch, nil