[geany/geany] db1b05: Update doc->priv->tag_tree_dirty only if doc is set

Enrico Tröger git-noreply at xxxxx
Sun Jan 2 18:05:21 UTC 2022


Branch:      refs/heads/master
Author:      Enrico Tröger <enrico.troeger at uvena.de>
Committer:   Enrico Tröger <enrico.troeger at uvena.de>
Date:        Sun, 02 Jan 2022 18:05:21 UTC
Commit:      db1b054abdaa693d5e7b08ff283f81e55f3e73c5
             https://github.com/geany/geany/commit/db1b054abdaa693d5e7b08ff283f81e55f3e73c5

Log Message:
-----------
Update doc->priv->tag_tree_dirty only if doc is set

This prevents a potential crash if sidebar_update_tag_list() is called
with update=true and document=NULL.


Modified Paths:
--------------
    src/sidebar.c

Modified: src/sidebar.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -191,7 +191,7 @@ void sidebar_update_tag_list(GeanyDocument *doc, gboolean update)
 
 	g_return_if_fail(doc == NULL || doc->is_valid);
 
-	if (update)
+	if (update && doc != NULL)
 		doc->priv->tag_tree_dirty = TRUE;
 
 	if (gtk_notebook_get_current_page(GTK_NOTEBOOK(main_widgets.sidebar_notebook)) != TREEVIEW_SYMBOL)



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list