mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Prevent crash when clicking on URI in chat if not matching app is found
This commit is contained in:
parent
ff38e96722
commit
0708862abe
2 changed files with 6 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ Group changes to describe their impact on the project, as follows:
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Admin weren't visible for non admin users in group chat rooms
|
- Admin weren't visible for non admin users in group chat rooms
|
||||||
|
- Crash when clicking on URI in chat if not matching app is found on Android to handle it
|
||||||
- LIME update threshold wasn't set, causing a request to be made after each REGISTER
|
- LIME update threshold wasn't set, causing a request to be made after each REGISTER
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
|
|
@ -505,14 +505,17 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) {
|
) {
|
||||||
it.consume { url ->
|
it.consume { url ->
|
||||||
|
val uri = Uri.parse(url)
|
||||||
val browserIntent = Intent(
|
val browserIntent = Intent(
|
||||||
Intent.ACTION_VIEW,
|
Intent.ACTION_VIEW,
|
||||||
Uri.parse(url)
|
uri
|
||||||
)
|
)
|
||||||
try {
|
try {
|
||||||
startActivity(browserIntent)
|
startActivity(browserIntent)
|
||||||
} catch (se: SecurityException) {
|
} catch (se: SecurityException) {
|
||||||
Log.e("[Chat Room] Failed to start browser intent, $se")
|
Log.e("[Chat Room] Failed to start browser intent from uri [$uri]: $se")
|
||||||
|
} catch (anfe: ActivityNotFoundException) {
|
||||||
|
Log.e("[Chat Room] Failed to find app matching intent from uri [$uri]: $anfe")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue