Skip to content

Commit 80a8708

Browse files
committed
Fix a minor bug in StopRepositoryImpl.
1 parent 6060030 commit 80a8708

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

spring-boot/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<groupId>fi.hsl.jore4</groupId>
1414
<artifactId>map-matching-backend</artifactId>
1515
<packaging>jar</packaging>
16-
<version>1.1.2</version>
16+
<version>1.1.3</version>
1717
<name>Jore4 Map Matching</name>
1818
<description>Jore4 map matching server</description>
1919

spring-boot/src/main/kotlin/fi/hsl/jore4/mapmatching/api/PublicTransportRouteMatchRequestDTO.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ data class PublicTransportRouteMatchRequestDTO(@field:Pattern(regexp = "[\\w\\d-
8080
val fallbackToViaNodesAlgorithm: Boolean?) {
8181

8282
private val isRoadJunctionMatchingEnabled: Boolean
83-
get() = roadJunctionMatchingEnabled?.let { it } != false
83+
get() = roadJunctionMatchingEnabled != false
8484

8585
@AssertTrue(message = "false")
8686
fun isJunctionNodeDistancesAbsentWhenJunctionMatchingDisabled(): Boolean =

spring-boot/src/main/kotlin/fi/hsl/jore4/mapmatching/repository/infrastructure/StopRepositoryImpl.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ class StopRepositoryImpl @Autowired constructor(val jdbcTemplate: NamedParameter
4848
val stopSideOnLink: LinkSide =
4949
when (rs.getBoolean("is_on_direction_of_link_forward_traversal")) {
5050
true -> LinkSide.RIGHT
51-
false -> LinkSide.LEFT
52-
null -> LinkSide.BOTH
51+
false -> {
52+
if (rs.wasNull()) // only rarely in the real world
53+
LinkSide.BOTH
54+
else
55+
LinkSide.LEFT
56+
}
5357
}
5458

5559
val infrastructureLinkId = rs.getLong("infrastructure_link_id")

0 commit comments

Comments
 (0)