Prevent error in Electron due to NWJS code

Former-commit-id: 38afb9bb4c3848b63cf4ae45b3e3142200b71db5 [formerly 7ea10eb85b2a1f4857da1a6a20b67dc23d69b732]
Former-commit-id: 3a61d478b45485e21da399b12edc7519efff9579
This commit is contained in:
Jaifroid 2020-02-26 16:02:47 +00:00
parent cc8688fa2d
commit 3534459e9c
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{
"name": "kiwix_js_windows",
"productName": "Kiwix JS for Windows Electron Edition",
"version": "0.9.93E",
"version": "0.9.97E",
"description": "Kiwix JS Windows Electron",
"main": "main.js",
"build-packaged": {

View File

@ -163,7 +163,7 @@ define(['q'], function(Q) {
reject(err);
} else {
var size = end - begin;
var arr = Buffer.alloc(size) || new Uint8Array(size);
var arr = typeof Buffer !== 'undefined' && Buffer.alloc(size) || new Uint8Array(size);
fs.read(fd, arr, 0, size, begin, function (err, bytesRead, data) {
if (err) reject(err);
fs.close(fd, function (err) {