[gnome-builder] diagnostics: ensure diagnostic has valid file



commit 57347b5b9b55a917781bfe2a4ed5e069556ae4df
Author: Christian Hergert <chergert redhat com>
Date:   Tue Nov 1 13:42:20 2016 -0700

    diagnostics: ensure diagnostic has valid file

 libide/diagnostics/ide-diagnostics-manager.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/libide/diagnostics/ide-diagnostics-manager.c b/libide/diagnostics/ide-diagnostics-manager.c
index bcbfd52..f97fba6 100644
--- a/libide/diagnostics/ide-diagnostics-manager.c
+++ b/libide/diagnostics/ide-diagnostics-manager.c
@@ -348,10 +348,13 @@ ide_diagnostics_group_diagnose_cb (GObject      *object,
           IdeDiagnostic *diagnostic = ide_diagnostics_index (diagnostics, i);
           GFile *file = ide_diagnostic_get_file (diagnostic);
 
-          if G_LIKELY (g_file_equal (file, group->file))
-            ide_diagnostics_group_add (group, provider, diagnostic);
-          else
-            ide_diagnostics_manager_add_diagnostic (self, provider, diagnostic);
+          if G_LIKELY (file != NULL)
+            {
+              if G_LIKELY (g_file_equal (file, group->file))
+                ide_diagnostics_group_add (group, provider, diagnostic);
+              else
+                ide_diagnostics_manager_add_diagnostic (self, provider, diagnostic);
+            }
         }
 
       if (length > 0)


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