Skip to content

Commit d44318a

Browse files
committed
[settings] fix types conversion
1 parent a233f85 commit d44318a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/src/main/java/me/capcom/smsgateway/modules/messages/MessagesSettings.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class MessagesSettings(
147147
}
148148

149149
LIMIT_VALUE -> {
150-
val limitValue = value?.toString()?.toInt()
150+
val limitValue = value?.toString()?.toFloat()?.toInt()
151151
if (limitValue != null && limitValue < 1) {
152152
throw IllegalArgumentException("Limit value must be >= 1")
153153
}
@@ -180,7 +180,7 @@ class MessagesSettings(
180180
}
181181

182182
LOG_LIFETIME_DAYS -> {
183-
val logLifetimeDays = value?.toString()?.toInt()
183+
val logLifetimeDays = value?.toString()?.toFloat()?.toInt()
184184
if (logLifetimeDays != null && logLifetimeDays < 1) {
185185
throw IllegalArgumentException("Log lifetime days must be >= 1")
186186
}

app/src/main/java/me/capcom/smsgateway/modules/webhooks/WebhooksSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class WebhooksSettings(
4949
}
5050

5151
RETRY_COUNT -> {
52-
val retryCount = value?.toString()?.toInt()
52+
val retryCount = value?.toString()?.toFloat()?.toInt()
5353
if (retryCount != null && retryCount < 1) {
5454
throw IllegalArgumentException("Retry count must be >= 1")
5555
}

0 commit comments

Comments
 (0)