[gnome-builder] code: avoid NULL contents usage



commit bf03358cf2f33fd9b9d3d36b34986916a9545077
Author: Christian Hergert <chergert redhat com>
Date:   Fri Feb 15 12:48:34 2019 -0800

    code: avoid NULL contents usage
    
    This saves us from some assertions that could happen if we haven't received
    any changes to the buffer yet.
    
    We might want to allow NULL, but I think this is fine for now.

 src/libide/code/ide-diagnostics-manager.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/libide/code/ide-diagnostics-manager.c b/src/libide/code/ide-diagnostics-manager.c
index 64627e3f7..c77356dba 100644
--- a/src/libide/code/ide-diagnostics-manager.c
+++ b/src/libide/code/ide-diagnostics-manager.c
@@ -469,6 +469,9 @@ ide_diagnostics_group_diagnose (IdeDiagnosticsGroup   *group,
   group->needs_diagnose = FALSE;
   group->has_diagnostics = FALSE;
 
+  if (group->contents == NULL)
+    group->contents = g_bytes_new ("", 0);
+
   ide_extension_set_adapter_foreach (group->adapter,
                                      ide_diagnostics_group_diagnose_foreach,
                                      self);


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