From 1073190b7eaff62c16d3792273b2fb5744511c14 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Fri, 01 Feb 2019 10:34:17 +0000
Subject: [PATCH] Add safeguard against unknown vehicle types

---
 parse.php |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/parse.php b/parse.php
index db486e2..df4e100 100644
--- a/parse.php
+++ b/parse.php
@@ -117,7 +117,12 @@
 			if(isset($this->jsonTrips[$jsonTripId])) {
 				$data = numToTypeB($gtfsTrip['id']);
 				$num = $gtfsTrip['num'];
-				if($data['num'] != $num) {
+				if(!is_array($data) || !isset($data['num'])) {
+					$data = [
+						'num' => $num,
+						'low' => 2,
+					];
+				} elseif($data['num'] != $num) {
 					// Ignore due to incorrect depot markings in the data
 					//fwrite(STDERR, 'Got '.$num.', database has '.$data['num']."\n");
 				}

--
Gitblit v1.9.1