tailer: fix nil client dereference on malformed log key

NewClient returns (nil, err) when a log list entry has an undecodable
key, but the error path called client.ShortID() on the nil client,
panicking the tailer goroutine and crashing the process.
This commit is contained in:
lakshit verma 2026-08-21 21:24:48 +05:30
parent 6f5b4c961f
commit 394174763d
No known key found for this signature in database

View file

@ -59,7 +59,7 @@ func (t *Tailer) Wait() {
func (t *Tailer) tailOne(ctx context.Context, lg loglist.Log, state string) {
client, err := rfc6962.NewClient(lg.Endpoint(), lg.Key)
if err != nil {
log.Printf("tail %s: %v", client.ShortID(), err)
log.Printf("tail %s: %v", lg.LogID, err)
return
}
id := lg.LogID