Skip to content
This repository was archived by the owner on Aug 16, 2025. It is now read-only.

Commit 62884bc

Browse files
committed
fix possible NPE
1 parent b2c5de1 commit 62884bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/kotlin/de/storchp/opentracks/osmplugin/map/reader/TrackpointReader.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ object TrackpointReader {
4242
)
4343

4444
/**
45-
* Reads the Trackpoints from the Content Uri and split by segments.
45+
* Reads the Trackpoints from the Content Uri and splits by segments.
4646
* Pause Trackpoints and different Track IDs split the segments.
4747
*/
4848
fun readTrackpointsBySegments(
@@ -68,7 +68,7 @@ object TrackpointReader {
6868
null
6969
).use { cursor ->
7070
var lastTrackpoint: Trackpoint? = null
71-
while (cursor!!.moveToNext()) {
71+
while (cursor?.moveToNext() == true) {
7272
debug.trackpointsReceived++
7373
val id = cursor.getLong(cursor.getColumnIndexOrThrow(ID))
7474
val trackId = cursor.getLong(cursor.getColumnIndexOrThrow(TRACKID))

0 commit comments

Comments
 (0)