Skip to content

Commit

Permalink
Merge pull request #5184 from pKallert/fix-workspace-switch
Browse files Browse the repository at this point in the history
BUGFIX: Change workspace runs into endless while-loop
  • Loading branch information
kitsunet authored Jul 26, 2024
2 parents dd5ed20 + 3472c61 commit 4de44b6
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -960,13 +960,12 @@ private function requireNonCircularRelationBetweenWorkspaces(Workspace $workspac
if ($workspace->workspaceName->equals($baseWorkspace->workspaceName)) {
throw new BaseWorkspaceEqualsWorkspaceException(sprintf('The base workspace of the target must be different from the given workspace "%s".', $workspace->workspaceName->value));
}

$nextBaseWorkspace = $baseWorkspace;
while ($nextBaseWorkspace->baseWorkspaceName !== null) {
while (!is_null($nextBaseWorkspace->baseWorkspaceName)) {
if ($workspace->workspaceName->equals($nextBaseWorkspace->baseWorkspaceName)) {
throw new CircularRelationBetweenWorkspacesException(sprintf('The workspace "%s" is already on the path of the target workspace "%s".', $workspace->workspaceName->value, $baseWorkspace->workspaceName->value));
}
$nextBaseWorkspace = $this->requireBaseWorkspace($workspace, $workspaceFinder);
$nextBaseWorkspace = $this->requireBaseWorkspace($nextBaseWorkspace, $workspaceFinder);
}
}

Expand Down

0 comments on commit 4de44b6

Please sign in to comment.