diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-05-29 15:24:22 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-29 15:27:43 +0200 |
| commit | 2510d1afaa82797abf368d345e1fbf3da5370c28 (patch) | |
| tree | 535cedcce64781b433a19b9e396219b26a521781 /pkg/report/linux.go | |
| parent | cdc5f8a23e5e370d0fa7867ff2a2f54cb8caeef9 (diff) | |
pkg/report: avoid producing no guilty file
If we produce no guilty file at all, the report is mailed only to LKML,
which is mostly equivalent to mailing to nobody.
If we skip all files, return the first one.
Diffstat (limited to 'pkg/report/linux.go')
| -rw-r--r-- | pkg/report/linux.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/report/linux.go b/pkg/report/linux.go index f914bc68d..76a41b3ac 100644 --- a/pkg/report/linux.go +++ b/pkg/report/linux.go @@ -445,6 +445,12 @@ nextFile: } return file } + // Avoid producing no guilty file at all, otherwise we mail the report to nobody. + // It's unclear if it's better to return the first one or the last one. + // So far the only test we have has only one file anyway. + if len(files) != 0 { + return files[0] + } return "" } |
