aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/services
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-01-05 00:40:50 -0500
committerAllan Wang <me@allanwang.ca>2019-01-05 00:40:50 -0500
commit26bedf4c47d4e918154edf456ee8a74e68a6faf4 (patch)
tree0fb6d23ee42e2a976af87b27500db54960e6f8ea /app/src/main/kotlin/com/pitchedapps/frost/services
parent4c32104d29de32cecf3c9647a8f628bd835e14cf (diff)
downloadfrost-26bedf4c47d4e918154edf456ee8a74e68a6faf4.tar.gz
frost-26bedf4c47d4e918154edf456ee8a74e68a6faf4.tar.bz2
frost-26bedf4c47d4e918154edf456ee8a74e68a6faf4.zip
Wrap parser calls with try catch, resolves #1298
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/services')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
index d036d3a8..f66f77e2 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt
@@ -117,7 +117,11 @@ enum class NotificationType(
* or -1 if an error occurred
*/
fun fetch(context: Context, data: CookieModel): Int {
- val response = parser.parse(data.cookie)
+ val response = try {
+ parser.parse(data.cookie)
+ } catch (ignored: Exception) {
+ null
+ }
if (response == null) {
L.v { "$name notification data not found" }
return -1