[geany/geany] 40fc67: Add a sanity check on the Save As callback

Colomban Wendling git-noreply at xxxxx
Sun Dec 16 18:06:47 UTC 2018


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Fri, 15 Jun 2018 20:34:57 UTC
Commit:      40fc6775a38c15699e30823c9ab204e1b555908d
             https://github.com/geany/geany/commit/40fc6775a38c15699e30823c9ab204e1b555908d

Log Message:
-----------
Add a sanity check on the Save As callback

Add a defensive check to make sure to catch the unlikely but maybe
theoretically possible case where the document last document is closed
while the Save As dialog is running.


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

Modified: src/dialogs.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -492,6 +492,7 @@ static gboolean handle_save_as(const gchar *utf8_filename, gboolean rename_file)
 	GeanyDocument *doc = document_get_current();
 	gboolean success = FALSE;
 
+	g_return_val_if_fail(doc != NULL, FALSE);
 	g_return_val_if_fail(!EMPTY(utf8_filename), FALSE);
 
 	if (doc->file_name != NULL)



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