[gnome-builder] editor: add warning when file is NULL



commit 27931e7676e7b6559f2938bb0533264873ce1489
Author: Christian Hergert <chergert redhat com>
Date:   Tue Oct 18 20:18:36 2016 -0700

    editor: add warning when file is NULL

 libide/editor/ide-editor-perspective.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libide/editor/ide-editor-perspective.c b/libide/editor/ide-editor-perspective.c
index 6619238..fba5b20 100644
--- a/libide/editor/ide-editor-perspective.c
+++ b/libide/editor/ide-editor-perspective.c
@@ -586,6 +586,12 @@ ide_editor_perspective_focus_location_full (IdeEditorPerspective *self,
   lookup.file = ide_source_location_get_file (location);
   lookup.view = NULL;
 
+  if (lookup.file == NULL)
+    {
+      g_warning ("IdeSourceLocation does not contain a file");
+      return;
+    }
+
   ide_perspective_views_foreach (IDE_PERSPECTIVE (self),
                                  ide_editor_perspective_find_source_location,
                                  &lookup);


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