Skip to content

Commit dea2245

Browse files
committed
Fix Close
1 parent e24a8fc commit dea2245

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/googlecloud/subscriber.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,11 @@ func (s *Subscriber) Close() error {
257257
s.clientLock.Lock()
258258
defer s.clientLock.Unlock()
259259

260-
err := s.client.Close()
261-
if err != nil {
262-
return fmt.Errorf("closing client: %w", err)
260+
if s.client != nil {
261+
err := s.client.Close()
262+
if err != nil {
263+
return fmt.Errorf("closing client: %w", err)
264+
}
263265
}
264266

265267
s.logger.Debug("Google Cloud PubSub subscriber closed", nil)

0 commit comments

Comments
 (0)