[gnome-builder] grep: Fix critical when searching from a project wide panel



commit 3d34facfb15af582294ba0cb0774227669a61f81
Author: vanadiae <vanadiae35 gmail com>
Date:   Sat Aug 7 00:34:26 2021 +0200

    grep: Fix critical when searching from a project wide panel

 src/plugins/grep/gbp-grep-panel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/grep/gbp-grep-panel.c b/src/plugins/grep/gbp-grep-panel.c
index 16b781f60..25fbdcb98 100644
--- a/src/plugins/grep/gbp-grep-panel.c
+++ b/src/plugins/grep/gbp-grep-panel.c
@@ -461,12 +461,14 @@ gbp_grep_panel_launch_search (GbpGrepPanel *self)
 
   g_assert (GBP_IS_GREP_PANEL (self));
 
+  model = gbp_grep_panel_get_model (self);
   /* Nothing's really reusable between search operations (and it isn't allowed anyway by
    * gbp_grep_model_scan_async()), so just start from a new one. The only part we keep
    * from it is the search directory because we can't modify it in the UI and so the
    * only place where it's actually stored is the (old) model.
    */
-  root_dir = gbp_grep_model_get_directory (gbp_grep_panel_get_model (self));
+  if (model)
+    root_dir = gbp_grep_model_get_directory (model);
   if (root_dir)
     g_object_ref (root_dir);
   model = gbp_grep_model_new (ide_widget_get_context (GTK_WIDGET (self)));


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