Guard JS http-batch-store accessing deleted chunk (#3134)

Workaround for https://github.com/attic-labs/noms/issues/3133.
This commit is contained in:
Ben Kalman
2017-01-31 11:36:27 -08:00
committed by GitHub
parent 10570f591e
commit aa583fa510
2 changed files with 7 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "@attic/noms",
"license": "Apache-2.0",
"version": "69.3.0",
"version": "69.4.0",
"description": "Noms JS SDK",
"repository": "https://github.com/attic-labs/noms/tree/master/js/noms",
"main": "dist/commonjs/noms.js",

View File

@@ -121,8 +121,12 @@ export class Delegate {
// Return success
chunks.forEach(chunk => {
const hashStr = chunk.hash.toString();
reqs[hashStr](chunk);
delete reqs[hashStr];
const req = reqs[hashStr];
// https://github.com/attic-labs/noms/issues/3133
if (req) {
req(chunk);
delete reqs[hashStr];
}
});
// Report failure