gtk-builder-tool: Error out if screenshooting fails
authorMatthias Clasen <mclasen@redhat.com>
Mon, 18 Apr 2022 15:16:05 +0000 (11:16 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 18 Apr 2022 15:16:05 +0000 (11:16 -0400)
If we don't produce a texture for whatever reason,
apologize and fail.

tools/gtk-builder-tool-screenshot.c

index 81bf22bd9af56a727d20b9119c710f11e86fe512..17c3731d98655b7ddbc7311f06eb070df7cc1107 100644 (file)
@@ -256,6 +256,12 @@ screenshot_file (const char *filename,
 
   g_object_unref (builder);
 
+  if (texture == NULL)
+    {
+      g_printerr ("Failed to take a screenshot\n");
+      exit (1);
+    }
+
   save_to = (char *)save_file;
 
   if (save_to == NULL)