[gedit] Do not crash on NULL subsection



commit f4ecdcb8807fec2594f62bf7a7f179063f31e41b
Author: Pietro Battiston <pbattiston src gnome org>
Date:   Wed Nov 30 10:02:17 2016 +0100

    Do not crash on NULL subsection
    
    Gedit would crash if both "preferences-section" and
    "tools-section" were extended.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737781

 gedit/gedit-app.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index f4ff434..2fbcd25 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -1712,6 +1712,11 @@ find_extension_point_section (GMenuModel  *model,
 
                        subsection = g_menu_model_get_item_link (model, i, G_MENU_LINK_SECTION);
 
+                       if (!subsection)
+                       {
+                               subsection = model;
+                       }
+
                        j_items = g_menu_model_get_n_items (subsection);
 
                        for (j = 0; j < j_items && !section; j++)


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