Skip to content

Commit af10040

Browse files
committed
Fix semver update version parsing to skip empty strings
Without this, for some insane reason "" is considered as 0.0.0 which breaks update detection given a release with an empty name.
1 parent ae1063b commit af10040

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/src/main/java/tech/httptoolkit/android/HttpToolkitApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ private data class GithubRelease(
298298
)
299299

300300
private fun tryParseSemver(version: String?): SemVer? = try {
301-
if (version == null) null
301+
if (version == null || version == "") null
302302
else SemVer.parse(
303303
// Strip leading 'v'
304304
version.replace(Regex("^v"), "")

0 commit comments

Comments
 (0)