Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit 9502679

Browse files
committed
this fixes #381
1 parent 0903486 commit 9502679

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

js/assets.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,18 @@ var cachedAssetsManager = (function() {
7878
return;
7979
}
8080
var onLoaded = function(bin) {
81-
if ( chrome.runtime.lastError ) {
82-
console.error(
83-
'HTTP Switchboard> cachedAssetsManager> getEntries():',
84-
chrome.runtime.lastError.message
85-
);
81+
// https://github.com/gorhill/httpswitchboard/issues/381
82+
// Maybe the index was requested multiple times and already
83+
// fetched by one of the occurrences.
84+
if ( entries === null ) {
85+
if ( chrome.runtime.lastError ) {
86+
console.error(
87+
'HTTP Switchboard> cachedAssetsManager> getEntries():',
88+
chrome.runtime.lastError.message
89+
);
90+
}
91+
entries = bin.cached_asset_entries || {};
8692
}
87-
entries = bin.cached_asset_entries || {};
8893
callback(entries);
8994
};
9095
chrome.storage.local.get('cached_asset_entries', onLoaded);

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 2,
33
"name": "__MSG_extName__",
44
"short_name": "HTTPSB",
5-
"version": "1.0.0.3",
5+
"version": "1.0.0.4",
66
"description": "__MSG_extShortDesc__",
77
"icons": {
88
"16": "icon_16.png",

0 commit comments

Comments
 (0)