diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-12-13 14:44:40 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-12-13 15:09:48 -0500 |
commit | 5c1ad88137f85caa0774a6e5e8371a4b50067ea7 (patch) | |
tree | 1355407b4ec3ee1981c42887f37c0abfb391ab85 /tools/gtk-builder-tool-simplify.c | |
parent | e230c9c6f0e5901bf99df8ee5081a75961c2787f (diff) | |
download | gtk+-5c1ad88137f85caa0774a6e5e8371a4b50067ea7.tar.gz |
builderparser: Be more robust
If a document contains no useful content,
just say so instead of crashing.
Diffstat (limited to 'tools/gtk-builder-tool-simplify.c')
-rw-r--r-- | tools/gtk-builder-tool-simplify.c | 6 |
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) |