[anjuta/gnome-2-26] Subversion: Don't crash if no paths are selected for committing.



commit 398ce1784e33de29f4eb7882568e18e3ee305d59
Author: James Liggett <jrliggett cox net>
Date:   Fri May 15 19:48:56 2009 -0700

    Subversion: Don't crash if no paths are selected for committing.
    
    Fixes bug 582825 â?? Anjuta crashes when there is no selected/changed file in the commit dialog
---
 plugins/subversion/svn-commit-command.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/plugins/subversion/svn-commit-command.c b/plugins/subversion/svn-commit-command.c
index c7b774b..c0d1d2e 100644
--- a/plugins/subversion/svn-commit-command.c
+++ b/plugins/subversion/svn-commit-command.c
@@ -98,6 +98,7 @@ svn_commit_command_run (AnjutaCommand *command)
 	commit_paths = apr_array_make (svn_command_get_pool (svn_command),
 								   g_list_length (self->priv->paths), 
 								   sizeof (char *));
+	error = NULL;
 	
 	while (current_path)
 	{
@@ -106,12 +107,15 @@ svn_commit_command_run (AnjutaCommand *command)
 		current_path = g_list_next (current_path);
 	}
 	
-	error = svn_client_commit3 (&commit_info, 
-								commit_paths, 
-								self->priv->recursive,
-								TRUE,
-								svn_command_get_client_context (svn_command), 
-								svn_command_get_pool (svn_command));
+	if (self->priv->paths)
+	{
+		error = svn_client_commit3 (&commit_info, 
+		                            commit_paths, 
+		                            self->priv->recursive,
+		                            TRUE,
+		                            svn_command_get_client_context (svn_command), 
+		                            svn_command_get_pool (svn_command));
+	}
 
 	if (error)
 	{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]