@@ -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