[gnome-maps] openTripPlanner: Check existence of color properties befor use



commit dbca7ea65fa800b0ad0c946677166dae172fb005
Author: Marcus Lundblad <ml update uu se>
Date:   Mon Nov 6 23:11:39 2017 +0100

    openTripPlanner: Check existence of color properties befor use
    
    https://bugzilla.gnome.org/show_bug.cgi?id=782861

 src/openTripPlanner.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/openTripPlanner.js b/src/openTripPlanner.js
index 52f7a8a..e0d209b 100644
--- a/src/openTripPlanner.js
+++ b/src/openTripPlanner.js
@@ -1157,9 +1157,9 @@ var OpenTripPlanner = new Lang.Class({
         let polyline = EPAF.decode(leg.legGeometry.points);
         let intermediateStops =
             this._createIntermediateStops(leg);
-        let color = this._isValidHexColor(leg.routeColor) ?
+        let color = leg.routeColor && this._isValidHexColor(leg.routeColor) ?
                     leg.routeColor : null;
-        let textColor = this._isValidHexColor(leg.routeTextColor) ?
+        let textColor = leg.routeTextColor && this._isValidHexColor(leg.routeTextColor) ?
                         leg.routeTextColor : null;
 
         /* instroduce an extra stop at the end (in additional to the


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]