|
|
@@ -262,6 +262,10 @@ public class Cargo extends EntitySupport<Cargo,TrackingId> {
|
|
262
|
262
|
* that describes a continuous route even if the cargo is currently misdirected.
|
|
263
|
263
|
*/
|
|
264
|
264
|
public Itinerary itineraryMergedWith(final Itinerary other) {
|
|
|
265
|
+ if (this.itinerary == null) {
|
|
|
266
|
+ return other;
|
|
|
267
|
+ }
|
|
|
268
|
+
|
|
265
|
269
|
if (isMisdirected() && transportStatus() == ONBOARD_CARRIER) {
|
|
266
|
270
|
final Leg currentLeg = Leg.deriveLeg(
|
|
267
|
271
|
currentVoyage(), lastKnownLocation(), currentVoyage().arrivalLocationAfterDepartureFrom(lastKnownLocation())
|