diff options
| author | David Göransson <david.goransson90@gmail.com> | 2024-01-23 08:06:15 +0100 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2024-02-05 17:51:37 +0100 |
| commit | 70a33111e13b0d4327c3132bd0e7b1e59e474fe4 (patch) | |
| tree | 640f5ae6de29f935bf0753c2c667ea053a2ef2fc /android/lib/common | |
| parent | eafd38b64dc6732496312424722c9465dfd6daff (diff) | |
| download | mullvadvpn-70a33111e13b0d4327c3132bd0e7b1e59e474fe4.tar.xz mullvadvpn-70a33111e13b0d4327c3132bd0e7b1e59e474fe4.zip | |
Fix too general Exception
Diffstat (limited to 'android/lib/common')
| -rw-r--r-- | android/lib/common/src/main/kotlin/net/mullvad/mullvadvpn/lib/common/util/CommonStringExtensions.kt | 4 |
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 } } |
