tailcfg: don't panic on clone of nil RegisterRequest

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-09-14 09:00:04 -07:00
committed by Brad Fitzpatrick
parent dabeda21e0
commit 3e2a7de2e9
2 changed files with 11 additions and 0 deletions

View File

@@ -546,3 +546,11 @@ func TestDiscoKeyAppend(t *testing.T) {
t.Errorf("got %q; want %q", got, want)
}
}
func TestRegisterRequestNilClone(t *testing.T) {
var nilReq *RegisterRequest
got := nilReq.Clone()
if got != nil {
t.Errorf("got = %v; want nil", got)
}
}