]> khamidou — GitHub mirrors - electron.git/commitdiff
:bug: Honor fs.readFileSync contract for empty packed asar file
authorPrince J Wesley <princejohnwesley@gmail.com>
Mon, 19 Oct 2015 03:03:22 +0000 (08:33 +0530)
committerPrince J Wesley <princejohnwesley@gmail.com>
Mon, 19 Oct 2015 03:13:50 +0000 (08:43 +0530)
atom/common/lib/asar.coffee

index 22d0e70b34fa4347365b9ab116eb828894c72cbb..d2a7799fa69436c030e838f0b849fe5de7e0bc6a 100644 (file)
@@ -263,7 +263,9 @@ exports.wrapFsWithAsar = (fs) ->
 
     info = archive.getFileInfo filePath
     notFoundError asarPath, filePath unless info
-    return new Buffer(0) if info.size is 0
+
+    if info.size is 0
+      return if options then '' else new Buffer(0)
 
     if info.unpacked
       realPath = archive.copyFileOut filePath