Fix NewSketch crash when directories.user is not set by alessio-perugini · Pull Request #2862 · arduino/arduino-cli (original) (raw)

Please check if the PR fulfills these requirements

See how to contribute

What kind of change does this PR introduce?

Fix a nil pointer

What is the current behavior?

When the directories.user is not set by the user, an empty string is returned instead of using the default value. This leads to a panic

What is the new behavior?

Use the UserDir function that correctly fallback to default dir in case of empty string.

Does this PR introduce a breaking change, and is titled accordingly?

Other information