Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Tue, 02 Jul 2024 09:08:05 UTC Commit: e5ee2227807c50604176b73119f9d8c90c6b0e02 https://github.com/geany/geany/commit/e5ee2227807c50604176b73119f9d8c90c6b0e...
Log Message: ----------- Fix runtime warning when opening Geany without open files
When Geany is opened with no open document, the following warning appears: ``` (geany:1735619): Geany-CRITICAL **: 10:49:58.729: document_get_notebook_child: assertion 'doc != NULL' failed ```
The corresponding stack trace when using `--g-fatal-warnings` is: ``` #5 0x0000fffff7c232c8 in document_get_notebook_child (doc=<optimized out>) at document.c:269 #6 0x0000fffff7c24140 in document_get_notebook_page (doc=<optimized out>) at document.c:291 #7 0x0000fffff7c25198 in document_show_tab (doc=0x0) at document.c:1269 #8 0x0000fffff7c4b24c in configuration_open_files (session_files=<optimized out>) at keyfile.c:1390 #9 0x0000fffff7c4b354 in configuration_open_default_session () at keyfile.c:1404 #10 0x0000fffff7c4dfb0 in load_startup_files (argv=0xffffffffeef8, argc=1) at libmain.c:987 ```
This patch fixes that.
Modified Paths: -------------- src/document.c
Modified: src/document.c 3 lines changed, 3 insertions(+), 0 deletions(-) =================================================================== @@ -1266,6 +1266,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).