[gnome-maps/wip/mlundblad/transit-plugin-gometro: 8/9] transitLegRow:	Handle legs with intermediate stops
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-maps/wip/mlundblad/transit-plugin-gometro: 8/9] transitLegRow:	Handle legs with intermediate stops
- Date: Mon, 10 Feb 2020 22:03:10 +0000 (UTC)
commit 89d7c29c12c35acd129197f7348c98c219e5b48f
Author: Marcus Lundblad <ml update uu se>
Date:   Wed Feb 5 22:59:18 2020 +0100
    transitLegRow: Handle legs with intermediate stops
 src/transitLegRow.js | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/transitLegRow.js b/src/transitLegRow.js
index 1d7444e3..142cf7c9 100644
--- a/src/transitLegRow.js
+++ b/src/transitLegRow.js
@@ -178,14 +178,16 @@ var TransitLegRow = GObject.registerClass({
 
     _populateInstructions() {
         if (this._leg.transit) {
-            let stops = this._leg.intermediateStops;
-            for (let index = 0; index < stops.length; index++) {
-                 let stop = stops[index];
-                 let row =
-                    new TransitStopRow.TransitStopRow({ visible: true,
-                                                        stop: stop,
-                                                        final: index === stops.length - 1 });
-                this._instructionList.add(row);
+            if (this._leg.intermediateStops) {
+                let stops = this._leg.intermediateStops;
+                for (let index = 0; index < stops.length; index++) {
+                    let stop = stops[index];
+                    let row =
+                        new TransitStopRow.TransitStopRow({ visible: true,
+                                                            stop: stop,
+                                                            final: index === stops.length - 1 });
+                    this._instructionList.add(row);
+                }
             }
         } else {
             /* don't output the starting and ending instructions from the walk
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]