Skip to content

Commit

Permalink
Merge pull request #8 from groob/fix_munki_crash
Browse files Browse the repository at this point in the history
check for nil result to prevent crash
  • Loading branch information
grahamgilbert authored Nov 1, 2021
2 parents 759f4eb + 82967c6 commit 5ecd9c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tables/munki/munki.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ func MunkiInfoGenerate(ctx context.Context, queryContext table.QueryContext) ([]
return nil, err
}

if report == nil { // no files found
return nil, nil
}

errors := strings.Join(report.Errors, ";")
warnings := strings.Join(report.Warnings, ";")
problemInstalls := strings.Join(report.ProblemInstalls, ";")
Expand Down Expand Up @@ -90,6 +94,9 @@ func MunkiInstallsGenerate(ctx context.Context, queryContext table.QueryContext)
if err != nil {
return nil, err
}
if report == nil {
return nil, nil
}
var results []map[string]string

for _, install := range report.ManagedInstalls {
Expand Down

0 comments on commit 5ecd9c7

Please sign in to comment.