From 7b72d470704b1256b9d9cdb7a50ef428ada5aa6c Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 13 Apr 2015 02:39:36 -0400 Subject: [PATCH] Zotero.File.putContentsAsync() fixes Breakage from e6ccca3230 --- chrome/content/zotero/xpcom/file.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index 6ca094f3a..8de5bf469 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -328,7 +328,7 @@ Zotero.File = new function(){ */ this.putContentsAsync = function putContentsAsync(path, data, charset) { if (path instanceof Ci.nsIFile) { - path = this.fileToPath(path); + path = path.path; } if (typeof data == 'string' && (!charset || charset.toLowerCase() == 'utf-8')) { @@ -355,7 +355,7 @@ Zotero.File = new function(){ } var deferred = Zotero.Promise.defer(), - ostream = FileUtils.openSafeFileOutputStream(file); + ostream = FileUtils.openSafeFileOutputStream(path); NetUtil.asyncCopy(data, ostream, function(inputStream, status) { if (!Components.isSuccessCode(status)) { deferred.reject(new Components.Exception("File write operation failed", status));