From 1d30b1fd82b69a90e5ad688ac9d64726ecdb93e9 Mon Sep 17 00:00:00 2001 From: Paulo Dias Date: Thu, 16 Nov 2023 18:59:40 +0000 Subject: [PATCH] plugins/remote-actions-extra/TakeControlMonitor: Prevent null pointer if no no entity name translation is known. --- .../plugins/remoteactionsextra/TakeControlMonitor.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins-dev/remote-actions-extra/src/java/pt/lsts/neptus/plugins/remoteactionsextra/TakeControlMonitor.java b/plugins-dev/remote-actions-extra/src/java/pt/lsts/neptus/plugins/remoteactionsextra/TakeControlMonitor.java index 0d175f8279..0e20ad5c71 100644 --- a/plugins-dev/remote-actions-extra/src/java/pt/lsts/neptus/plugins/remoteactionsextra/TakeControlMonitor.java +++ b/plugins-dev/remote-actions-extra/src/java/pt/lsts/neptus/plugins/remoteactionsextra/TakeControlMonitor.java @@ -34,6 +34,7 @@ import pt.lsts.imc.EntityState; import pt.lsts.imc.VehicleState; +import pt.lsts.neptus.NeptusLog; import pt.lsts.neptus.console.events.ConsoleEventMainSystemChange; import javax.swing.JButton; @@ -92,8 +93,13 @@ public void on(ConsoleEventMainSystemChange evt) { } public void on(EntityState msg) { - if (!msg.getSourceName().equals(parent.getMainVehicleId()) - || !msg.getEntityName().equals(entityName)) { + try { + if (!msg.getSourceName().equals(parent.getMainVehicleId()) + || !msg.getEntityName().equals(entityName)) { + return; + } + } catch (Exception e) { + NeptusLog.pub().warn(e.getMessage()); return; }