From 9fcba8edfaf1c9fede52b1a23a1a0807246df13e Mon Sep 17 00:00:00 2001 From: Arthur Poiret Date: Fri, 31 Mar 2023 18:16:45 +0200 Subject: [PATCH] fix(host): avoid NPE if a JAXBException occurs on scanner execution --- .../main/java/com/owlplug/core/tasks/PluginSyncTask.java | 2 +- .../owlplug/host/loaders/EmbeddedScannerPluginLoader.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/owlplug-client/src/main/java/com/owlplug/core/tasks/PluginSyncTask.java b/owlplug-client/src/main/java/com/owlplug/core/tasks/PluginSyncTask.java index f98b7290..4f0f490d 100644 --- a/owlplug-client/src/main/java/com/owlplug/core/tasks/PluginSyncTask.java +++ b/owlplug-client/src/main/java/com/owlplug/core/tasks/PluginSyncTask.java @@ -166,7 +166,7 @@ protected TaskResult call() throws Exception { } } - log.debug(collectedPluginFiles.size() + " plugins collected"); + log.info(collectedPluginFiles.size() + " plugins collected"); //Save all discovered symlinks symlinkDAO.saveAll(collectedSymlinks); diff --git a/owlplug-host/src/main/java/com/owlplug/host/loaders/EmbeddedScannerPluginLoader.java b/owlplug-host/src/main/java/com/owlplug/host/loaders/EmbeddedScannerPluginLoader.java index fd2821e2..d95d33d0 100644 --- a/owlplug-host/src/main/java/com/owlplug/host/loaders/EmbeddedScannerPluginLoader.java +++ b/owlplug-host/src/main/java/com/owlplug/host/loaders/EmbeddedScannerPluginLoader.java @@ -181,7 +181,9 @@ private List createPluginsFromCommandOutput(String output) { outputXML = outputXML.strip(); JuceXMLPlugin plugin = createJucePluginFromRawXml(outputXML); - plugins.add(plugin.toNativePlugin()); + if (plugin != null) { + plugins.add(plugin.toNativePlugin()); + } } else { log.trace("No XML tag can be extracted from part {} for plugin", i); @@ -209,7 +211,7 @@ private JuceXMLPlugin createJucePluginFromRawXml(String xml) { } catch (JAXBException e) { log.error("Error during XML mapping", e); - log.debug(xml); + log.error(xml); return null; } }