NIFI-11963 Added null check in system test for instance cache method

- Timing issues in system integration tests could sometimes fail with a NullPointerException when calling the poison method multiple times

This closes #7618

Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
Robert Kalmar 2023-08-17 15:58:35 +02:00 committed by exceptionfactory
parent 680acf89ed
commit 25d775b965
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
1 changed files with 3 additions and 0 deletions

View File

@ -103,6 +103,9 @@ public class NiFiInstanceCache {
} }
public void poison(final NiFiInstance toPoison) { public void poison(final NiFiInstance toPoison) {
if (this.instance == null) {
return;
}
final NiFiInstance rawInstance = this.instance.getRawInstance(); final NiFiInstance rawInstance = this.instance.getRawInstance();
if (Objects.equals(rawInstance, toPoison)) { if (Objects.equals(rawInstance, toPoison)) {