Fix NS_BASE_STREAM_CLOSED error, for real
The input stream produced by asyncFetch is closed automatically at EOL, so the available() call throws this for an empty file.
This commit is contained in:
parent
ee777c5be6
commit
77f12527aa
4 changed files with 18 additions and 8 deletions
|
@ -1,4 +1,11 @@
|
|||
describe("Zotero.File", function () {
|
||||
describe("#getContentsAsync()", function () {
|
||||
it("should handle an empty file", function* () {
|
||||
var path = OS.Path.join(getTestDataDirectory().path, "empty");
|
||||
assert.equal((yield Zotero.File.getContentsAsync(path)), "");
|
||||
})
|
||||
})
|
||||
|
||||
describe("#copyDirectory()", function () {
|
||||
it("should copy all files within a directory", function* () {
|
||||
var tmpDir = Zotero.getTempDirectory().path;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue