nil,nil is no policy and no error. Allow it

This commit is contained in:
riccardom
2026-06-09 13:29:14 +02:00
parent bd9fed41ad
commit 1f3e5a2ace
2 changed files with 2 additions and 0 deletions

View File

@@ -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)

View File

@@ -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)