summaryrefslogtreecommitdiffhomepage
path: root/android/lib/common
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2024-02-05 17:52:40 +0100
committerAlbin <albin@mullvad.net>2024-02-05 17:52:40 +0100
commitd805c6e12522f3b5adaaac21626beae4ab8021d7 (patch)
treef74203cf70bf23b59768d710749e8a400d8c667d /android/lib/common
parent8bdc0e8dcc52bf82c3e39903257d1b430dc6c2b9 (diff)
parentf7cb264dbfbc0356bc4426d17ce6eb045c122d81 (diff)
downloadmullvadvpn-d805c6e12522f3b5adaaac21626beae4ab8021d7.tar.xz
mullvadvpn-d805c6e12522f3b5adaaac21626beae4ab8021d7.zip
Merge branch 'try-replacing-ktfmt-with-detekt-droid-559'
Diffstat (limited to 'android/lib/common')
-rw-r--r--android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/CommonStringExtensions.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/CommonStringExtensions.kt b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/CommonStringExtensions.kt
index 06a2de9148..536fea3d24 100644
--- a/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/CommonStringExtensions.kt
+++ b/android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/CommonStringExtensions.kt
@@ -10,7 +10,9 @@ private const val SPACE_CHAR = ' '
fun String.parseAsDateTime(): DateTime? {
return try {
DateTime.parse(this, DateTimeFormat.forPattern(EXPIRY_FORMAT))
- } catch (ex: Exception) {
+ } catch (ex: IllegalArgumentException) {
+ null
+ } catch (ex: UnsupportedOperationException) {
null
}
}