From 99a2fe7c96564262e8d2fd70a572d668d3f3d943 Mon Sep 17 00:00:00 2001 From: Georg Henzler Date: Wed, 27 Feb 2019 23:42:22 +0000 Subject: [PATCH] FELIX-6072 NPE fix git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1854490 13f79535-47bb-0310-9956-ffa450edef68 --- .../hc/generalchecks/util/ScriptEnginesTracker.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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);