@@ -225,15 +225,17 @@ class ApplySettings implements NodeSettingsService.Listener {
225
225
@ Override
226
226
public void onRefreshSettings (Settings settings ) {
227
227
GroovyScriptEngineService engine = (GroovyScriptEngineService ) ScriptService .this .scriptEngines .get ("groovy" );
228
- String [] patches = settings .getAsArray (GroovyScriptEngineService .GROOVY_SCRIPT_BLACKLIST_PATCH , Strings .EMPTY_ARRAY );
229
- if (Arrays .equals (patches , engine .blacklistAdditions ()) == false ) {
230
- logger .info ("updating [{}] from {} to {}" , GroovyScriptEngineService .GROOVY_SCRIPT_BLACKLIST_PATCH ,
231
- engine .blacklistAdditions (), patches );
232
- engine .blacklistAdditions (patches );
233
- engine .reloadConfig ();
234
- // Because the GroovyScriptEngineService knows nothing about the
235
- // cache, we need to clear it here if the setting changes
236
- ScriptService .this .clearCache ();
228
+ if (engine != null ) {
229
+ String [] patches = settings .getAsArray (GroovyScriptEngineService .GROOVY_SCRIPT_BLACKLIST_PATCH , Strings .EMPTY_ARRAY );
230
+ if (Arrays .equals (patches , engine .blacklistAdditions ()) == false ) {
231
+ logger .info ("updating [{}] from {} to {}" , GroovyScriptEngineService .GROOVY_SCRIPT_BLACKLIST_PATCH ,
232
+ engine .blacklistAdditions (), patches );
233
+ engine .blacklistAdditions (patches );
234
+ engine .reloadConfig ();
235
+ // Because the GroovyScriptEngineService knows nothing about the
236
+ // cache, we need to clear it here if the setting changes
237
+ ScriptService .this .clearCache ();
238
+ }
237
239
}
238
240
}
239
241
}
0 commit comments