[gnome-builder] buffer: protect against NULL source location
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] buffer: protect against NULL source location
- Date: Thu, 28 Apr 2016 08:31:12 +0000 (UTC)
commit 367303a10dd9836bce85e9bba935b0241ffcacec
Author: Christian Hergert <christian hergert me>
Date: Thu Apr 28 00:57:17 2016 -0700
buffer: protect against NULL source location
libide/ide-buffer.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index 5a6ff1d..ae0cf45 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -163,7 +163,12 @@ ide_buffer_get_has_diagnostics (IdeBuffer *self)
{
IdeDiagnostic *diag = ide_diagnostics_index (priv->diagnostics, i);
IdeSourceLocation *loc = ide_diagnostic_get_location (diag);
- IdeFile *file = ide_source_location_get_file (loc);
+ IdeFile *file;
+
+ if (loc == NULL)
+ continue;
+
+ file = ide_source_location_get_file (loc);
if (priv->file && file && ide_file_equal (priv->file, file))
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]