[gnome-builder/gnome-builder-3-20] build: check for error



commit e042dd80a5959dff4cbbc2d79a4fe946304b93ad
Author: Christian Hergert <chergert redhat com>
Date:   Tue May 10 14:53:51 2016 +0300

    build: check for error
    
    While our g_error_matches() call is safe from dereferences, we immediately
    dereference right after. So we still need the check.

 plugins/build-tools/gbp-build-workbench-addin.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/build-tools/gbp-build-workbench-addin.c b/plugins/build-tools/gbp-build-workbench-addin.c
index d7f2d14..51b1b3d 100644
--- a/plugins/build-tools/gbp-build-workbench-addin.c
+++ b/plugins/build-tools/gbp-build-workbench-addin.c
@@ -83,7 +83,7 @@ gbp_build_workbench_addin_build_cb (GObject      *object,
 
   build_result = ide_builder_build_finish (builder, result, &error);
 
-  if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+  if (error != NULL && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
     g_message ("%s", error->message);
 }
 


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