File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -900,7 +900,13 @@ func UpdatePullRequestWithStack(
900900 tx meta.WriteTx ,
901901 branchName string ,
902902) error {
903- branchMeta , _ := tx .Branch (branchName )
903+ branchMeta , exists := tx .Branch (branchName )
904+ // it's possible that this branch is not part of the primary stack, ex: they have main->branchA->branchB,
905+ // but forkA is coming from branchA in which case forkA may not have a pull request associated with it.
906+ // In this case, we should not try to update forkA's pull request with the stack.
907+ if ! exists || branchMeta .PullRequest == nil {
908+ return nil
909+ }
904910 logrus .WithField ("branch" , branchName ).
905911 WithField ("pr" , branchMeta .PullRequest .ID ).
906912 Debug ("Updating pull requests with stack" )
You can’t perform that action at this time.
0 commit comments