mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] FennecWebAppIntentProcessor: Catch JSONException.
This commit is contained in:
parent
274ab54236
commit
09efe75e27
@ -24,8 +24,10 @@ import mozilla.components.feature.pwa.ManifestStorage
|
||||
import mozilla.components.feature.pwa.ext.putWebAppManifest
|
||||
import mozilla.components.feature.pwa.ext.toCustomTabConfig
|
||||
import mozilla.components.feature.session.SessionUseCases
|
||||
import mozilla.components.support.base.log.logger.Logger
|
||||
import mozilla.components.support.utils.SafeIntent
|
||||
import mozilla.components.support.utils.toSafeIntent
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import org.mozilla.fenix.R
|
||||
import java.io.File
|
||||
@ -40,6 +42,7 @@ class FennecWebAppIntentProcessor(
|
||||
private val loadUrlUseCase: SessionUseCases.DefaultLoadUrlUseCase,
|
||||
private val storage: ManifestStorage
|
||||
) : IntentProcessor {
|
||||
val logger = Logger("FennecWebAppIntentProcessor")
|
||||
|
||||
/**
|
||||
* Returns true if this intent should launch a progressive web app created in Fennec.
|
||||
@ -113,6 +116,10 @@ class FennecWebAppIntentProcessor(
|
||||
|
||||
WebAppManifestParser().parse(manifestField).getOrNull()
|
||||
} catch (e: IOException) {
|
||||
logger.error("Failed to parse web app manifest due to IOException", e)
|
||||
null
|
||||
} catch (e: JSONException) {
|
||||
logger.error("Failed to parse web app manifest due to JSONException", e)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user