summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-12-13 14:44:40 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-12-13 15:09:48 -0500
commit5c1ad88137f85caa0774a6e5e8371a4b50067ea7 (patch)
tree1355407b4ec3ee1981c42887f37c0abfb391ab85 /tools
parente230c9c6f0e5901bf99df8ee5081a75961c2787f (diff)
downloadgtk+-5c1ad88137f85caa0774a6e5e8371a4b50067ea7.tar.gz
builderparser: Be more robust
If a document contains no useful content, just say so instead of crashing.
Diffstat (limited to 'tools')
-rw-r--r--tools/gtk-builder-tool-simplify.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/gtk-builder-tool-simplify.c b/tools/gtk-builder-tool-simplify.c
index bb8e1ebd62..635b6332fa 100644
--- a/tools/gtk-builder-tool-simplify.c
+++ b/tools/gtk-builder-tool-simplify.c
@@ -2301,6 +2301,12 @@ simplify_file (const char *filename,
return FALSE;
}
+ if (data.root == NULL)
+ {
+ g_printerr (_("Can't parse ā€œ%sā€\n"), filename);
+ return FALSE;
+ }
+
data.builder = gtk_builder_new ();
if (data.convert3to4)