From 970b1e21d02c532580e3ff7a80e537f739a7b779 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 13 Apr 2024 16:13:57 -0700 Subject: [PATCH] ipn/ipnlocal: inline assertClientLocked into its now sole caller Updates #11649 Change-Id: I8e2a5e59125a0cad5c0a8c9ed8930585f1735d03 Signed-off-by: Brad Fitzpatrick --- ipn/ipnlocal/local.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 5a6bca277..750c7eaf4 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -2839,7 +2839,9 @@ func (b *LocalBackend) tryLookupUserName(uid string) string { // up the in-progress flow where it left off. func (b *LocalBackend) StartLoginInteractive() { b.mu.Lock() - b.assertClientLocked() + if b.cc == nil { + panic("LocalBackend.assertClient: b.cc == nil") + } b.interact = true url := b.authURL timeSinceAuthURLCreated := b.clock.Since(b.authURLTime) @@ -4729,13 +4731,6 @@ func (b *LocalBackend) Logout(ctx context.Context) error { return b.resetForProfileChangeLockedOnEntry(unlock) } -// assertClientLocked crashes if there is no controlclient in this backend. -func (b *LocalBackend) assertClientLocked() { - if b.cc == nil { - panic("LocalBackend.assertClient: b.cc == nil") - } -} - // setNetInfo sets b.hostinfo.NetInfo to ni, and passes ni along to the // controlclient, if one exists. func (b *LocalBackend) setNetInfo(ni *tailcfg.NetInfo) {