From 40e2a7703fa5dc8bc06a2e974412a79d49d38626 Mon Sep 17 00:00:00 2001 From: Brian Gates Date: Tue, 17 Feb 2026 19:13:25 -0500 Subject: [PATCH] Fix panic when remote discovery fails and no controllers configured (fixes #953) (#957) * Fix panic when remote discovery fails and no controllers are configured Call setDefaults(&u.Default) before logController(&u.Default) when len(u.Controllers) == 0 so HashPII, DropPII, etc. are initialized and logController does not dereference nil pointers. Co-authored-by: Cursor * chore: trigger CI re-run Co-authored-by: Cursor * ci: use golangci-lint v2.9 for Go 1.26-compatible deps Co-authored-by: Cursor --------- Co-authored-by: Cursor --- .github/workflows/build.yml | 4 +++- pkg/inputunifi/interface.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d669821..7c3d317d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,4 +48,6 @@ jobs: uses: golangci/golangci-lint-action@v9 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v2.6 + # v2.9 is built with Go 1.26 so it can type-check deps (e.g. golang.org/x/crypto, x/net) that include go1.26-only files. + version: v2.9 + skip-cache: true diff --git a/pkg/inputunifi/interface.go b/pkg/inputunifi/interface.go index ffa5ac92..8ba5ae2c 100644 --- a/pkg/inputunifi/interface.go +++ b/pkg/inputunifi/interface.go @@ -74,6 +74,7 @@ func (u *InputUnifi) Initialize(l poller.Logger) error { } if len(u.Controllers) == 0 { + u.setDefaults(&u.Default) u.Logf("No controllers configured. Polling dynamic controllers only! Defaults:") u.logController(&u.Default) } @@ -108,6 +109,7 @@ func (u *InputUnifi) DebugInput() (bool, error) { } if len(u.Controllers) == 0 { + u.setDefaults(&u.Default) u.Logf("No controllers configured. Polling dynamic controllers only! Defaults:") u.logController(&u.Default) }