[gnome-builder] diagnostics: warn and bail



commit bcac96de1f0369ca1c31b868bb769dbabd5da878
Author: Christian Hergert <chergert redhat com>
Date:   Fri Jan 5 20:51:21 2018 -0800

    diagnostics: warn and bail
    
    I'm not happy that we hit this, but we might as well bail for
    now instead of crashing.

 src/libide/diagnostics/ide-diagnostics-manager.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/libide/diagnostics/ide-diagnostics-manager.c 
b/src/libide/diagnostics/ide-diagnostics-manager.c
index a3558b2..7dd142c 100644
--- a/src/libide/diagnostics/ide-diagnostics-manager.c
+++ b/src/libide/diagnostics/ide-diagnostics-manager.c
@@ -326,7 +326,16 @@ ide_diagnostics_group_diagnose_cb (GObject      *object,
    * finalized), we should be guaranteed we have a valid group.
    */
   group = g_object_get_data (G_OBJECT (provider), "IDE_DIAGNOSTICS_GROUP");
-  g_assert (group != NULL);
+
+  if (group == NULL)
+    {
+      /* Warning and bail if we failed to get the diagnostic group.
+       * This shouldn't be happening, but I have definitely seen it
+       * so it is probably related to disposal.
+       */
+      g_warning ("Failed to locate group, possibly disposed.");
+      return;
+    }
 
   /*
    * Clear all of our old diagnostics no matter where they ended up.


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