SIGN IN SIGN UP
juanfont / headscale UNCLAIMED

An open source, self-hosted implementation of the Tailscale control server

0 0 43 Go

types: fix nil panics in Owner() and TailscaleUserID() for orphaned nodes

Owner() on a non-tagged node with nil User returns an invalid
UserView that panics when Name() is called. Add a guard to return
an empty UserView{} when the user is not valid.

TailscaleUserID() calls UserID().Get() without checking Valid()
first, which panics on orphaned nodes (no tags, no UserID). Add a
validity check to return 0 for this invalid state.

Callers should check Owner().Valid() before accessing fields.
K
Kristoffer Dalby committed
4064f13bda2929aeff6f9b8ac5d3f1b8dd5fb946
Parent: 3037e5e
Committed by Kristoffer Dalby <kristoffer@dalby.cc> on 4/10/2026, 12:18:56 PM