[gnome-builder] source-view: add assertion showing priv->mode was set



commit 4604d3a9f29c639d20571f28e9809e52c2d74003
Author: Christian Hergert <christian hergert me>
Date:   Mon Apr 18 19:11:15 2016 -0700

    source-view: add assertion showing priv->mode was set
    
    This gets set during set_mode(), and therefore should always be non-NULL
    after the call.

 libide/ide-source-view.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-source-view.c b/libide/ide-source-view.c
index a5a411e..39e23a2 100644
--- a/libide/ide-source-view.c
+++ b/libide/ide-source-view.c
@@ -2170,9 +2170,11 @@ ide_source_view_do_mode (IdeSourceView *self,
         ret = TRUE;
     }
 
-  if (!priv->mode)
+  if (priv->mode == NULL)
     ide_source_view_real_set_mode (self, suggested_default, IDE_SOURCE_VIEW_MODE_TYPE_PERMANENT);
 
+  g_assert (priv->mode != NULL);
+
   if (ide_source_view_mode_get_mode_type (priv->mode) == IDE_SOURCE_VIEW_MODE_TYPE_PERMANENT)
     g_string_erase (priv->command_str, 0, -1);
 


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