aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-14 21:18:21 -0500
committerTed Gould <ted@gould.cx>2011-03-14 21:18:21 -0500
commit55df9a8ae37c9758b4c5e2957972cc09bb81b19b (patch)
tree4309fac7387b98f8420d8f4f643041880f5bc024
parent475701b3933b5bb54b46eed36deb3cdfe6bc2f92 (diff)
parent1da844ec47972d1f88a039d0234d77084ba558cb (diff)
downloadlibdbusmenu-55df9a8ae37c9758b4c5e2957972cc09bb81b19b.tar.gz
libdbusmenu-55df9a8ae37c9758b4c5e2957972cc09bb81b19b.tar.bz2
libdbusmenu-55df9a8ae37c9758b4c5e2957972cc09bb81b19b.zip
Handle NULL better in finding the label
-rw-r--r--libdbusmenu-gtk/parser.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index 1b032bb..2a057b4 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -371,14 +371,20 @@ sanitize_label_text (const gchar * label)
which we don't. */
gchar * sanitized = NULL;
GError * error = NULL;
+
+ if (label == NULL) {
+ return NULL;
+ }
+
if (pango_parse_markup (label, -1, 0, NULL, &sanitized, NULL, &error)) {
return sanitized;
}
- else {
+
+ if (error != NULL) {
g_warning ("Could not parse '%s': %s", label, error->message);
g_error_free (error);
- return g_strdup (label);
}
+ return g_strdup (label);
}
static gchar *