From 364654b685c64b40ec2a914cac2fc6ba8c246fc8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 19 Oct 2021 12:33:47 +0200 Subject: [PATCH] Fix crash on slash commands Exceptions --- changelog.d/4261.bugfix | 1 + .../features/home/room/detail/composer/TextComposerViewModel.kt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/4261.bugfix diff --git a/changelog.d/4261.bugfix b/changelog.d/4261.bugfix new file mode 100644 index 0000000000..4283335131 --- /dev/null +++ b/changelog.d/4261.bugfix @@ -0,0 +1 @@ +Fix crash on slash commands Exceptions \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerViewModel.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerViewModel.kt index 08f44f30f7..73b400e8d5 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/composer/TextComposerViewModel.kt @@ -709,7 +709,7 @@ class TextComposerViewModel @AssistedInject constructor( val event = try { block() TextComposerViewEvents.SlashCommandResultOk - } catch (failure: Exception) { + } catch (failure: Throwable) { TextComposerViewEvents.SlashCommandResultError(failure) } _viewEvents.post(event)