Jacek Kowalski
2019-02-01 1073190b7eaff62c16d3792273b2fb5744511c14
Add safeguard against unknown vehicle types
1 files modified
7 ■■■■ changed files
parse.php 7 ●●●● patch | view | raw | blame | history
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");
                }