buildertool: Be more robust
authorMatthias Clasen <mclasen@redhat.com>
Mon, 13 Dec 2021 19:19:12 +0000 (14:19 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 13 Dec 2021 19:33:19 +0000 (14:33 -0500)
A lot of crashes in simplify can be avoided
if get_class_name does not return NULL.

tools/gtk-builder-tool-simplify.c

index 404a38b2d7f97518f12b74009d7725c841cb3ecf..bb8e1ebd625b0bb0bb107d41a270e59af867ffda 100644 (file)
@@ -486,7 +486,7 @@ get_attribute_value (Element *element,
         return element->attribute_values[i];
     }
 
-  return NULL;
+  return "";
 }
 
 static void
@@ -549,7 +549,7 @@ get_class_name (Element *element)
         return get_attribute_value (parent, "class");
     }
 
-  return NULL;
+  return "";
 }
 
 static gboolean