Skip to content

Commit 84ef896

Browse files
committed
Only shutdown if control is defined
1 parent e214898 commit 84ef896

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core-backup/src/test/scala/io/aiven/guardian/kafka/backup/BackupClientControlWrapper.scala

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,10 @@ class BackupClientControlWrapper[T <: KafkaConsumer](backupClient: BackupClientI
1919
def run(): Unit =
2020
control = backupClient.backup.run()
2121

22-
def shutdown(): Future[Done] = control.drainAndShutdown()
22+
@SuppressWarnings(Array("DisableSyntax.null"))
23+
def shutdown(): Future[Done] =
24+
if (control != null)
25+
control.drainAndShutdown()
26+
else
27+
Future.successful(Done)
2328
}

0 commit comments

Comments
 (0)