Commit 3a2a5331 authored by Romain Courteaud's avatar Romain Courteaud

[indexeddb] Fix getAttachment with huge blob

The array buffer length was higher than what is stored in indexedDB
parent 56f2c38f
...@@ -474,8 +474,7 @@ ...@@ -474,8 +474,7 @@
var index = parseInt( var index = parseInt(
cursor.primaryKey.slice(key_path.length + 1), cursor.primaryKey.slice(key_path.length + 1),
10 10
), );
i;
if ((start !== 0) && (index < start_index)) { if ((start !== 0) && (index < start_index)) {
// No need to fetch blobs at the start // No need to fetch blobs at the start
...@@ -486,12 +485,6 @@ ...@@ -486,12 +485,6 @@
return; return;
} }
i = index - start_index;
// Extend array size
while (i > promise_list.length) {
promise_list.push(null);
i -= 1;
}
// Sort the blob by their index // Sort the blob by their index
promise_list.splice( promise_list.splice(
index - start_index, index - start_index,
...@@ -548,13 +541,8 @@ ...@@ -548,13 +541,8 @@
var index = parseInt( var index = parseInt(
cursor.primaryKey.slice(key_path.length + 1), cursor.primaryKey.slice(key_path.length + 1),
10 10
), );
i = index;
// Extend array size
while (i > array_buffer_list.length) {
array_buffer_list.push(null);
i -= 1;
}
// Sort the blob by their index // Sort the blob by their index
array_buffer_list.splice( array_buffer_list.splice(
index, index,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment