From 1f3e5a2ace36ea5b2b44f3a5f3a9ebfd0e813559 Mon Sep 17 00:00:00 2001 From: riccardom Date: Tue, 9 Jun 2026 13:29:14 +0200 Subject: [PATCH] nil,nil is no policy and no error. Allow it --- client/mdm/policy_darwin.go | 1 + client/mdm/policy_windows.go | 1 + 2 files changed, 2 insertions(+) diff --git a/client/mdm/policy_darwin.go b/client/mdm/policy_darwin.go index 090779bc7..a644e695c 100644 --- a/client/mdm/policy_darwin.go +++ b/client/mdm/policy_darwin.go @@ -54,6 +54,7 @@ func loadPlatformPolicy() (map[string]any, error) { if errors.Is(err, fs.ErrNotExist) { // Not enrolled for NetBird. Caller treats nil as // "no MDM source present". + //nolint:nilnil // (nil, nil) is the documented platform-absent sentinel; see LoadPolicy. return nil, nil } return nil, fmt.Errorf("open %s: %w", policyPlistPath, err) diff --git a/client/mdm/policy_windows.go b/client/mdm/policy_windows.go index 93191e5ac..27d4dbf85 100644 --- a/client/mdm/policy_windows.go +++ b/client/mdm/policy_windows.go @@ -86,6 +86,7 @@ func loadPlatformPolicy() (map[string]any, error) { if err != nil { if errors.Is(err, registry.ErrNotExist) { // Not enrolled. Caller treats nil as "no MDM source present". + //nolint:nilnil // (nil, nil) is the documented platform-absent sentinel; see LoadPolicy. return nil, nil } return nil, fmt.Errorf("open %s: %w", policyRegistryPath, err)