[gtk/matthiasc/for-main] gtk-builder-tool: Error out if screenshooting fails




commit e89365e9e3750735cf23d220c311dc3d359cc566
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 18 11:16:05 2022 -0400

    gtk-builder-tool: Error out if screenshooting fails
    
    If we don't produce a texture for whatever reason,
    apologize and fail.

 tools/gtk-builder-tool-screenshot.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/tools/gtk-builder-tool-screenshot.c b/tools/gtk-builder-tool-screenshot.c
index 81bf22bd9a..17c3731d98 100644
--- a/tools/gtk-builder-tool-screenshot.c
+++ b/tools/gtk-builder-tool-screenshot.c
@@ -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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]