Fixed crash when trying to take off from an undefined planet

This commit is contained in:
Unknown 2020-03-22 15:03:14 +01:00 committed by unknown
parent 901622e45c
commit 1fbeccadb1

View file

@ -902,7 +902,8 @@ public class JumpSequencer extends AbstractSequencer {
case HYPERSPACE_ENTERING: { case HYPERSPACE_ENTERING: {
// anything defined? // anything defined?
if (celestialObjectSource.parent == null) { if ( celestialObjectSource == null
|| celestialObjectSource.parent == null ) {
reason.append(Commons.getStyleWarning(), "warpdrive.ship.guide.unable_to_reach_hyperspace_no_parent", reason.append(Commons.getStyleWarning(), "warpdrive.ship.guide.unable_to_reach_hyperspace_no_parent",
Commons.format(worldSource), worldSource.provider.getDimension()); Commons.format(worldSource), worldSource.provider.getDimension());
return false; return false;
@ -927,7 +928,8 @@ public class JumpSequencer extends AbstractSequencer {
case PLANET_TAKEOFF: { case PLANET_TAKEOFF: {
// anything defined? // anything defined?
if (celestialObjectSource.parent == null) { if ( celestialObjectSource == null
|| celestialObjectSource.parent == null ) {
reason.append(Commons.getStyleWarning(), "warpdrive.ship.guide.unable_to_reach_space_no_parent", reason.append(Commons.getStyleWarning(), "warpdrive.ship.guide.unable_to_reach_space_no_parent",
Commons.format(worldSource), worldSource.provider.getDimension()); Commons.format(worldSource), worldSource.provider.getDimension());
return false; return false;