[geany/geany] 458f4f: Don't warn when trying to close a document when none are open

Colomban Wendling git-noreply at xxxxx
Sun Jul 21 11:50:25 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 21 Jul 2013 11:50:25 UTC
Commit:      458f4f2e75d1a48eae2cb3d3f08c01e11dcb8243
             https://github.com/geany/geany/commit/458f4f2e75d1a48eae2cb3d3f08c01e11dcb8243

Log Message:
-----------
Don't warn when trying to close a document when none are open

When using the document close keybinding, it is legitimate for the
callback to be called even if there are no documents open, so properly
check for this.

Closes [bugs:#941]


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

Modified: src/callbacks.c
5 files changed, 2 insertions(+), 3 deletions(-)
===================================================================
@@ -221,9 +221,8 @@ G_MODULE_EXPORT void on_close1_activate(GtkMenuItem *menuitem, gpointer user_dat
 {
 	GeanyDocument *doc = document_get_current();
 
-	g_return_if_fail(doc != NULL);
-
-	document_close(doc);
+	if (doc != NULL)
+		document_close(doc);
 }
 
 



--------------
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