diff --git a/src/duplicacy_b2client.go b/src/duplicacy_b2client.go index e889e5e..af92979 100644 --- a/src/duplicacy_b2client.go +++ b/src/duplicacy_b2client.go @@ -335,7 +335,9 @@ func (client *B2Client) ListFileNames(startFileName string, singleFile bool, inc return nil, err } - defer readCloser.Close() + if readCloser != nil { + defer readCloser.Close() + } output := B2ListFileNamesOutput{}