Prevent NPE in CargoPanel.

This commit is contained in:
Mike Pope 2017-02-01 20:29:29 +10:30
parent d385568856
commit bd2576f48c
1 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ public class CargoPanel extends FreeColPanel
*/
@Override
public boolean accepts(Unit unit) {
return carrier.canAdd(unit);
return carrier != null && carrier.canAdd(unit);
}
/**
@ -190,7 +190,7 @@ public class CargoPanel extends FreeColPanel
*/
@Override
public boolean accepts(Goods goods) {
return carrier.canAdd(goods);
return carrier != null && carrier.canAdd(goods);
}
/**