Skip to content

Commit bea895c

Browse files
committed
null check on closeGlobalContainer
1 parent da15a55 commit bea895c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

IntelliJ/src/main/java/com/nuix/enginebaseline/NuixEngine.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ protected NuixEngine() {
7979
}
8080

8181
public static void closeGlobalContainer() {
82-
globalContainer.close();
83-
globalContainer = null;
82+
if (globalContainer != null) {
83+
globalContainer.close();
84+
globalContainer = null;
85+
}
8486
}
8587

8688
/***
@@ -567,7 +569,7 @@ public RubyScriptRunner runRubyScriptAsync(String script, @Nullable Map<String,
567569
RubyScriptRunner rubyScriptRunner = new RubyScriptRunner();
568570
rubyScriptRunner.setStandardOutputConsumer(standardOutputReceiver);
569571
rubyScriptRunner.setErrorOutputConsumer(errorOutputReceiver);
570-
if(completedCallback != null) {
572+
if (completedCallback != null) {
571573
rubyScriptRunner.whenScriptCompletes(completedCallback);
572574
}
573575
rubyScriptRunner.runScriptAsync(script, getNuixVersionString(), vars);
@@ -650,7 +652,7 @@ public RubyScriptRunner runRubyScriptFileAsync(File scriptFile, @Nullable Map<St
650652
RubyScriptRunner rubyScriptRunner = new RubyScriptRunner();
651653
rubyScriptRunner.setStandardOutputConsumer(standardOutputReceiver);
652654
rubyScriptRunner.setErrorOutputConsumer(errorOutputReceiver);
653-
if(completedCallback != null) {
655+
if (completedCallback != null) {
654656
rubyScriptRunner.whenScriptCompletes(completedCallback);
655657
}
656658
rubyScriptRunner.runFileAsync(scriptFile, getNuixVersionString(), vars);

0 commit comments

Comments
 (0)