diff --git a/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/util/ScriptEnginesTracker.java b/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/util/ScriptEnginesTracker.java index af0ebd378e3..3ebd9673017 100644 --- a/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/util/ScriptEnginesTracker.java +++ b/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/util/ScriptEnginesTracker.java @@ -110,13 +110,14 @@ private void registerFactories(Bundle bundle) { private void unregisterFactories(Bundle bundle) { List languagesForBundle = languagesByBundle.get(bundle); - for (String lang : languagesForBundle) { - ScriptEngineFactory removed = enginesByLanguage.remove(lang); - LOG.info("Removing ScriptEngine {} for language {}", removed, lang); + if(languagesForBundle != null) { + for (String lang : languagesForBundle) { + ScriptEngineFactory removed = enginesByLanguage.remove(lang); + LOG.info("Removing ScriptEngine {} for language {}", removed, lang); + } } } - @SuppressWarnings("unchecked") private List getScriptEngineFactoriesForBundle(final Bundle bundle) { URL url = bundle.getEntry(ENGINE_FACTORY_SERVICE);