Skip to content

Commit

Permalink
plugins/remote-actions-extra/TakeControlMonitor: Prevent null pointer…
Browse files Browse the repository at this point in the history
… if no no entity name translation is known.
  • Loading branch information
paulosousadias committed Nov 16, 2023
1 parent 0a91fc0 commit 1d30b1f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 1d30b1f

Please sign in to comment.