aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/unified_window_controller.vala
diff options
context:
space:
mode:
authorhrxi <hrrrxi@gmail.com>2019-09-01 18:18:25 +0200
committerfiaxh <fiaxh@users.noreply.github.com>2019-09-10 19:36:11 +0200
commitd5d305193ce527f1cc3022c406de35d9a85d4ccb (patch)
treed12efc741319a7d71c13f7bf6c2c7579d25fdabe /main/src/ui/unified_window_controller.vala
parent9950742bf1903291c271619aea101b0e2f81d19c (diff)
downloaddino-d5d305193ce527f1cc3022c406de35d9a85d4ccb.tar.gz
dino-d5d305193ce527f1cc3022c406de35d9a85d4ccb.zip
Fix some warnings
Instances of `RegexError` are just asserted as `assert_not_reached` as they cannot really fail except for allocation failure if the given regex is valid.
Diffstat (limited to 'main/src/ui/unified_window_controller.vala')
-rw-r--r--main/src/ui/unified_window_controller.vala12
1 files changed, 10 insertions, 2 deletions
diff --git a/main/src/ui/unified_window_controller.vala b/main/src/ui/unified_window_controller.vala
index 1ca3daae..21725574 100644
--- a/main/src/ui/unified_window_controller.vala
+++ b/main/src/ui/unified_window_controller.vala
@@ -153,11 +153,19 @@ public class UnifiedWindowController : Object {
private void update_conversation_topic(string? subtitle = null) {
if (subtitle != null) {
- conversation_topic = (/\s+/).replace_literal(subtitle, -1, 0, " ");
+ try {
+ conversation_topic = (/\s+/).replace_literal(subtitle, -1, 0, " ");
+ } catch (RegexError e) {
+ assert_not_reached();
+ }
} else if (conversation.type_ == Conversation.Type.GROUPCHAT) {
string? subject = stream_interactor.get_module(MucManager.IDENTITY).get_groupchat_subject(conversation.counterpart, conversation.account);
if (subject != null) {
- conversation_topic = (/\s+/).replace_literal(subject, -1, 0, " ");
+ try {
+ conversation_topic = (/\s+/).replace_literal(subject, -1, 0, " ");
+ } catch (RegexError e) {
+ assert_not_reached();
+ }
} else {
conversation_topic = null;
}