Skip to content

Commit

Permalink
FIX Add conditional before adding
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Aug 28, 2023
1 parent 1d65ff0 commit 46e9d90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion funcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ function branches(
}
if (!$version) {
$version = preg_replace('#[^0-9\.]#', '', $json->require->{'silverstripe/assets'} ?? '');
$matchedOnBranchThreeLess = true;
if ($version) {
$matchedOnBranchThreeLess = true;
}
}
if (!$version) {
$version = preg_replace('#[^0-9\.]#', '', $json->require->{'cwp/starter-theme'} ?? '');
Expand Down
4 changes: 4 additions & 0 deletions tests/BranchesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ public function provideBranches()
EOT,
'branchesJson' => <<<EOT
[
{"name": "1"},
{"name": "1.0"},
{"name": "2"},
{"name": "2.0"},
{"name": "3"},
{"name": "3.0"},
{"name": "3.1"},
Expand Down

0 comments on commit 46e9d90

Please sign in to comment.