Skip to content

Commit f69e480

Browse files
authored
Merge pull request #79 from symfony-cli/panic-fix-hen-no-local-php-detected-on-new
Fix a panic when running symfony new without any PHP version installed
2 parents e72b102 + 088317a commit f69e480

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

commands/local_new.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,10 @@ 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-
return strings.Join(strings.Split(minor.Version, ".")[0:2], "."), err
372+
if err != nil {
373+
return "", err
374+
}
375+
return strings.Join(strings.Split(minor.Version, ".")[0:2], "."), nil
373376
}
374377
if _, err := version.NewVersion(v); err != nil {
375378
return "", errors.Errorf("unable to parse PHP version \"%s\"", v)

0 commit comments

Comments
 (0)