diff options
author | Robert Tari <robert@tari.in> | 2023-05-05 04:31:30 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2023-05-07 20:52:12 +0200 |
commit | c9b2de2b43d1575a85b5d0344c4a0bd1eb9f93fa (patch) | |
tree | 3ffcbe261e7b8d92bbdefc3abca80dd235c99773 /src/toggle-box.vala | |
parent | 1c150a74abe1fa91d353903e5122ec6895bf23fd (diff) | |
download | arctica-greeter-c9b2de2b43d1575a85b5d0344c4a0bd1eb9f93fa.tar.gz arctica-greeter-c9b2de2b43d1575a85b5d0344c4a0bd1eb9f93fa.tar.bz2 arctica-greeter-c9b2de2b43d1575a85b5d0344c4a0bd1eb9f93fa.zip |
Add missing error handlers
Diffstat (limited to 'src/toggle-box.vala')
-rw-r--r-- | src/toggle-box.vala | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/toggle-box.vala b/src/toggle-box.vala index 0c6bf57..12072b1 100644 --- a/src/toggle-box.vala +++ b/src/toggle-box.vala @@ -2,6 +2,7 @@ * * Copyright (C) 2012 Canonical Ltd * Copyright (C) 2015,2017 Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + * Copyright (C) 2023 Robert Tari * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as @@ -17,6 +18,7 @@ * * Authors: Michael Terry <michael.terry@canonical.com> * Mike Gabriel <mike.gabriel@das-netzwerkteam.de> + * Robert Tari <robert@tari.in> */ public class ToggleBox : Gtk.Box @@ -72,7 +74,17 @@ public class ToggleBox : Gtk.Box } /* Split font family and size via regular expression. */ - Regex font_regexp = new Regex ("^([[:blank:]]*)(?<font_family>[ a-zA-Z0-9]+) (?<font_size>[0-9]+)([[:blank:]]*)$"); + Regex font_regexp = null; + + try + { + font_regexp = new Regex ("^([[:blank:]]*)(?<font_family>[ a-zA-Z0-9]+) (?<font_size>[0-9]+)([[:blank:]]*)$"); + } + catch (GLib.RegexError pError) + { + error ("Panic: Failed constructing RegEx: %s", pError.message); + } + MatchInfo font_info; if (font_regexp.match(font, 0, out font_info)) { font_family = font_info.fetch_named("font_family"); |