From d5d305193ce527f1cc3022c406de35d9a85d4ccb Mon Sep 17 00:00:00 2001 From: hrxi Date: Sun, 1 Sep 2019 18:18:25 +0200 Subject: 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. --- main/src/ui/unified_window_controller.vala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'main/src/ui/unified_window_controller.vala') 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; } -- cgit v1.2.3-70-g09d2