Skip to content

Commit 7e46b73

Browse files
committed
Fix a panic when running symfony new without any PHP version installed
1 parent e72b102 commit 7e46b73

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

commands/local_new.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ func forcePHPVersion(v, dir string) (string, error) {
369369
store := phpstore.New(util.GetHomeDir(), true, nil)
370370
if v == "" {
371371
minor, _, _, err := store.BestVersionForDir(dir)
372+
if err != nil {
373+
return "", err
374+
}
372375
return strings.Join(strings.Split(minor.Version, ".")[0:2], "."), err
373376
}
374377
if _, err := version.NewVersion(v); err != nil {

0 commit comments

Comments
 (0)