From cc3259f8d9ff32994cdbeba6045abe3e73986e06 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 2 Nov 2020 08:51:12 -0800 Subject: [PATCH] ipn: fix crash generating machine key on new installs Regression from d6ad41dceaf20f (for #732). Probably also means eab6e9ea4e45 was unnecessary, but it's fine. Fixes #887 --- ipn/local.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 + } }() }