Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Thu, 01 Aug 2024 21:12:17 UTC Commit: edd733013047c1f2a4786a64e2364f8b30c41be9 https://github.com/geany/geany/commit/edd733013047c1f2a4786a64e2364f8b30c41b...
Log Message: ----------- Merge pull request #3921 from techee/warning_fix
Fix some runtime warnings
Modified Paths: -------------- src/document.c
Modified: src/document.c 6 lines changed, 5 insertions(+), 1 deletions(-) =================================================================== @@ -351,9 +351,10 @@ GeanyDocument *document_get_from_notebook_child(GtkWidget *page) GEANY_API_SYMBOL GeanyDocument *document_get_from_page(guint page_num) { + gint pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)); GtkWidget *parent;
- if (page_num >= documents_array->len) + if (page_num >= pages) return NULL;
parent = gtk_notebook_get_nth_page(GTK_NOTEBOOK(main_widgets.notebook), page_num); @@ -1266,6 +1267,9 @@ void document_apply_indent_settings(GeanyDocument *doc)
void document_show_tab(GeanyDocument *doc) { + if (!doc) + return; + gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), document_get_notebook_page(doc));
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).