Author: ericwa
Date: Tue Mar 25 18:46:57 2014
New Revision: 10638

URL: http://svn.gna.org/viewcvs/etoile?rev=10638&view=rev
Log:
Branches inspector: fix crash on double click with no selection

Modified:
    
trunk/Etoile/Frameworks/CoreObject/Samples/ProjectDemo/EWBranchesWindowController.m

Modified: 
trunk/Etoile/Frameworks/CoreObject/Samples/ProjectDemo/EWBranchesWindowController.m
URL: 
http://svn.gna.org/viewcvs/etoile/trunk/Etoile/Frameworks/CoreObject/Samples/ProjectDemo/EWBranchesWindowController.m?rev=10638&r1=10637&r2=10638&view=diff
==============================================================================
--- 
trunk/Etoile/Frameworks/CoreObject/Samples/ProjectDemo/EWBranchesWindowController.m
 (original)
+++ 
trunk/Etoile/Frameworks/CoreObject/Samples/ProjectDemo/EWBranchesWindowController.m
 Tue Mar 25 18:46:57 2014
@@ -85,6 +85,9 @@
 
 - (COBranch *)selectedBranch
 {
+       if ([table selectedRow] == -1)
+               return nil;
+       
     COBranch *branch = [[self orderedBranches] objectAtIndex: [table 
selectedRow]];
     return branch;
 }
@@ -95,8 +98,11 @@
        {
                COBranch *branch = [self selectedBranch];
                
-        [_persistentRoot setCurrentBranch: branch];
-               [self commitWithIdentifier: @"set-branch"];
+               if (branch != nil)
+               {
+                       [_persistentRoot setCurrentBranch: branch];
+                       [self commitWithIdentifier: @"set-branch"];
+               }
        }
 }
 


_______________________________________________
Etoile-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-cvs

Reply via email to