Skip to content

Commit

Permalink
Support null arrival and departure
Browse files Browse the repository at this point in the history
stopTimeUpdate may have null arrival and departure properties, such as when scheduleRelationship is SKIPPED
  • Loading branch information
CodeFusion authored Feb 18, 2024
1 parent af9ff77 commit 7b85b15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ function getDescendantProp(obj, desc, defaultvalue) {
const arr = desc.split('.');
while (arr.length) {
const nextKey = arr.shift();
if (nextKey.includes('[')) {
if (obj == null) {
return defaultvalue;
} else if (nextKey.includes('[')) {
const arrayKey = nextKey.match(/(\w*)\[(\d+)\]/);
if (obj[arrayKey[1]] === undefined) {
return defaultvalue;
Expand Down

0 comments on commit 7b85b15

Please sign in to comment.