Alpha WebDAV support ()

This commit is contained in:
Antonio Navarro Perez 2021-03-01 19:04:59 +01:00 committed by GitHub
parent 0f513ef8b3
commit ed8bd64017
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 447 additions and 93 deletions

View file

@ -61,8 +61,13 @@ func (d *torrentFile) IsDir() bool {
}
func (d *torrentFile) Close() error {
err := d.reader.Close()
var err error
if d.reader != nil {
err = d.reader.Close()
}
d.reader = nil
return err
}

View file

@ -44,4 +44,5 @@ func TestTorrentFilesystem(t *testing.T) {
require.NoError(err)
require.NotNil(f)
require.Equal(f.Size(), int64(1964275))
require.NoError(f.Close())
}