Skip to content

Commit

Permalink
fix when fmsPath is null
Browse files Browse the repository at this point in the history
  • Loading branch information
flogross89 committed Feb 17, 2025
1 parent ccba336 commit 05b44d7
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions fbw-a380x/src/systems/systems-host/systems/EfisTawsBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class EfisTawsBridge implements Instrument {
/** If track from one segment differs more than 3° from previous track, paint grey area */
private readonly trackChangeDistance = MappedSubject.create(
([path, track]) => {
if (track === null || path.length === 0) {
if (track === null || !path || path.length === 0) {
return -1;
}

Expand All @@ -328,15 +328,17 @@ export class EfisTawsBridge implements Instrument {

private readonly terrVdPathData = MappedSubject.create(
([fmsPath, trackChangeDistance]) => {
const waypoints = fmsPath
.filter((p) => p.type !== PathVectorType.DebugPoint)
.map((p) => {
const waypoint: WaypointDto = {
latitude: p.startPoint.lat,
longitude: p.startPoint.long,
};
return waypoint;
});
const waypoints = !fmsPath
? []
: fmsPath
.filter((p) => p.type !== PathVectorType.DebugPoint)
.map((p) => {
const waypoint: WaypointDto = {
latitude: p.startPoint.lat,
longitude: p.startPoint.long,
};
return waypoint;
});

const data: ElevationSamplePathDto = {
pathWidth: 1,
Expand Down

0 comments on commit 05b44d7

Please sign in to comment.