[gnome-maps/wip/mlundblad/transit-plugin-gometro: 3/4] 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: 3/4] transitLegRow: Handle legs with intermediate stops
- Date: Wed, 5 Feb 2020 22:02:41 +0000 (UTC)
commit c3223ca8541eb8c4b4d0d8f4858b655ff08e7a41
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]