From: Matthias Clasen Date: Wed, 12 Jul 2023 19:49:11 +0000 (-0400) Subject: buildertool: Exit orderly X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~1^2~65^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ab809d1dc35f8984eb2f64cac70956eb11598576;p=gtk4.git buildertool: Exit orderly The validate command does need a display connection, for better or worse. So exit in an orderly fashion if we don't have one, instead of crashing. Fixes: #5948 --- diff --git a/tools/gtk-builder-tool-validate.c b/tools/gtk-builder-tool-validate.c index 011b8b8d79..7cd0695b19 100644 --- a/tools/gtk-builder-tool-validate.c +++ b/tools/gtk-builder-tool-validate.c @@ -263,6 +263,12 @@ do_validate (int *argc, const char ***argv) }; int i; + if (gdk_display_get_default () == NULL) + { + g_printerr (_("Could not initialize windowing system\n")); + exit (1); + } + g_set_prgname ("gtk4-builder-tool validate"); context = g_option_context_new (NULL); g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);