Skip to content

Commit 4b8a005

Browse files
committed
Add null checks
1 parent a6891de commit 4b8a005

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/main/java/com/conveyal/r5/labeling/NoSteepInclinesTraversalPermissionLabeler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ public class NoSteepInclinesTraversalPermissionLabeler extends USTraversalPermis
1313
Double maxIncline;
1414
boolean stepFree;
1515
public NoSteepInclinesTraversalPermissionLabeler (TransportNetworkConfig config) {
16-
if (config.maxIncline != null) this.maxIncline = config.maxIncline;
17-
this.stepFree = config.stepFree;
16+
if (config != null) {
17+
if (config.maxIncline != null) this.maxIncline = config.maxIncline;
18+
this.stepFree = config.stepFree;
19+
}
1820
}
1921
@Override
2022
public RoadPermission getPermissions(Way way) {

src/main/java/com/conveyal/r5/streets/StreetLayer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,12 @@ public StreetLayer(TransportNetworkConfig config) {
227227
"Unknown traversal permission labeler: " + config.traversalPermissionLabeler
228228
);
229229
};
230+
231+
stepFree = config.stepFree;
232+
230233
} else {
231234
permissionLabeler = new USTraversalPermissionLabeler();
232235
}
233-
234-
stepFree = config.stepFree;
235-
236236
}
237237

238238
/** Load street layer from an OSM-lib OSM DB */

0 commit comments

Comments
 (0)