mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
envknob: ensure f is not nil before using it
This PR fixes a panic that I saw in the mac app where parsing the env file fails but we don't get to see the error due to the panic of using f.Name() Fixes #11425 Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
This commit is contained in:
parent
08ebac9acb
commit
da7c3d1753
@ -492,7 +492,11 @@ func ApplyDiskConfig() (err error) {
|
||||
defer func() {
|
||||
if err != nil {
|
||||
// Stash away our return error for the healthcheck package to use.
|
||||
applyDiskConfigErr = fmt.Errorf("error parsing %s: %w", f.Name(), err)
|
||||
if f != nil {
|
||||
applyDiskConfigErr = fmt.Errorf("error parsing %s: %w", f.Name(), err)
|
||||
} else {
|
||||
applyDiskConfigErr = fmt.Errorf("error applying disk config: %w", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user