mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-04-15 07:16:34 +00:00
Merge pull request #439 from replicatedhq/divolgin/nil
Don't panic when no data is collected
This commit is contained in:
@@ -19,6 +19,10 @@ func NewResult() CollectorResult {
|
||||
}
|
||||
|
||||
func (r CollectorResult) SaveResult(bundlePath string, relativePath string, reader io.Reader) error {
|
||||
if reader == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if bundlePath == "" {
|
||||
data, err := ioutil.ReadAll(reader)
|
||||
if err != nil {
|
||||
@@ -28,10 +32,6 @@ func (r CollectorResult) SaveResult(bundlePath string, relativePath string, read
|
||||
return nil
|
||||
}
|
||||
|
||||
if reader == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
r[relativePath] = nil // save the the file name referencing the file on disk
|
||||
|
||||
fileDir, fileName := filepath.Split(relativePath)
|
||||
|
||||
Reference in New Issue
Block a user