diff --git a/ipn/local.go b/ipn/local.go index f41f47d98..6a8ff8406 100644 --- a/ipn/local.go +++ b/ipn/local.go @@ -708,7 +708,9 @@ func (b *LocalBackend) initMachineKeyLocked() (err error) { if err != nil { return } - b.prefs.Persist.LegacyFrontendPrivateMachineKey = b.machinePrivKey + if b.prefs != nil && b.prefs.Persist != nil { + b.prefs.Persist.LegacyFrontendPrivateMachineKey = b.machinePrivKey + } }() }