Skip to content

Commit 03040ab

Browse files
Make sure locationSegments have segments before removing trailing slash
1 parent fde1148 commit 03040ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/kotlin/at/bitfire/dav4jvm/ktor/Response.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ data class Response(
204204

205205
// don't compare trailing slash segment ("")
206206
var nBasePathSegments = locationSegments.size
207-
if (locationSegments[nBasePathSegments - 1] == "") // TODO: Ricki, Not sure if this is still needed
207+
if (locationSegments.isNotEmpty() && location.rawSegments.last() == "")
208208
nBasePathSegments--
209209

210210
/* example: locationSegments = [ "davCollection", "" ]

0 commit comments

Comments
 (0)