Skip to content

Commit

Permalink
Merge pull request #24 from creative-commoners/pulls/1.0/watea
Browse files Browse the repository at this point in the history
FIX Add conditional before adding
  • Loading branch information
GuySartorelli authored Aug 28, 2023
2 parents e5ce291 + 46e9d90 commit 8bc5884
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 8bc5884

Please sign in to comment.