From 2ca1a16c939b9be24cedc4d0a104324ab91c0eed Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sun, 25 Oct 2020 14:10:28 +0000 Subject: [PATCH] Fix electron file reading Former-commit-id: 7db4f76d9b75787c5ae2d4af063c9ccec6082567 [formerly 3cb81126c551b29f6db9a2548c308982fe2f74b2 [formerly e4cb20724bd435b08d429e476019919f2792d0a9]] Former-commit-id: b340a2557fa46aa850361d297b83712baabceba5 Former-commit-id: 2415c5e39288bd8ad60d99ca501344720a5f8df3 --- www/js/lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/lib/util.js b/www/js/lib/util.js index 5148edda..edde9a43 100644 --- a/www/js/lib/util.js +++ b/www/js/lib/util.js @@ -203,7 +203,7 @@ define(['q'], function(Q) { * @returns {Promise} A Promise for an array buffer with the read data */ function readFileSlice(file, begin, end) { - if ('arrayBuffer' in Blob.prototype) { + if (file.slice && 'arrayBuffer' in Blob.prototype) { // DEV: This method uses the native arrayBuffer method of Blob, if available, as it eliminates // the need to use FileReader and set up event listeners; it also uses the method's native Promise // rather than setting up potentially hundreds of new Q promises for small byte range reads