From b26aa96bb420abdb4605d68fe1a322a90f3343a8 Mon Sep 17 00:00:00 2001
From: Daniel Slomovits <daniels220@gmail.com>
Date: Fri, 15 Dec 2023 20:47:38 -0500
Subject: [PATCH] Actually have to return nil from selectedBranch to prevent
 the original error, even though the command is disabled

---
 Iceberg-TipUI/IceTipResetBranchToThisCommitCommand.class.st | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Iceberg-TipUI/IceTipResetBranchToThisCommitCommand.class.st b/Iceberg-TipUI/IceTipResetBranchToThisCommitCommand.class.st
index 9c0a69f18b..ea6141bfc0 100644
--- a/Iceberg-TipUI/IceTipResetBranchToThisCommitCommand.class.st
+++ b/Iceberg-TipUI/IceTipResetBranchToThisCommitCommand.class.st
@@ -18,7 +18,7 @@ IceTipResetBranchToThisCommitCommand class >> defaultDescription [
 { #category : 'testing' }
 IceTipResetBranchToThisCommitCommand >> canBeExecuted [
 
-	^ self selectedBranch notNil and: [ self selectedBranch isBranch ]
+	^ self selectedBranch notNil
 ]
 
 { #category : 'executing' }
@@ -55,7 +55,9 @@ IceTipResetBranchToThisCommitCommand >> name [
 { #category : 'accessing' }
 IceTipResetBranchToThisCommitCommand >> selectedBranch [
 
-	^ self context model
+	| selected |
+	selected := self context model.
+	^ (selected notNil and: [ selected isBranch ]) ifTrue: [ selected ]
 ]
 
 { #category : 'accessing' }