File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,9 @@ public async Task<bool> CheckoutBranchByDecoratorAsync(Models.Decorator decorato
242242
243243 public async Task CheckoutBranchByCommitAsync ( Models . Commit commit )
244244 {
245+ if ( commit == null )
246+ return ;
247+
245248 if ( commit . IsCurrentHead )
246249 return ;
247250
@@ -265,7 +268,7 @@ public async Task CheckoutBranchByCommitAsync(Models.Commit commit)
265268 continue ;
266269
267270 var lb = _repo . Branches . Find ( x => x . IsLocal && x . Upstream == rb . FullName ) ;
268- if ( lb is { TrackStatus . Ahead . Count : 0 } )
271+ if ( lb != null && lb . TrackStatus != null && lb . TrackStatus . Behind . Count > 0 && lb . TrackStatus . Ahead . Count == 0 )
269272 {
270273 if ( _repo . CanCreatePopup ( ) )
271274 _repo . ShowPopup ( new CheckoutAndFastForward ( _repo , lb , rb ) ) ;
You can’t perform that action at this time.
0 commit comments