1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-05 11:37:01 +02:00

Properly handle potential exception from webext API

Related feedback:
- https://github.com/uBlockOrigin/uAssets/discussions/16939#discussioncomment-5356808
This commit is contained in:
Raymond Hill 2023-03-19 07:25:06 -04:00
parent 6e87026d40
commit 2f42cf61ab
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1383,10 +1383,13 @@ vAPI.adminStorage = (( ) => {
},
};
}
const cacheManagedStorage = ( ) => {
webext.storage.managed.get().then(store => {
webext.storage.local.set({ cachedManagedStorage: store || {} });
});
const cacheManagedStorage = async ( ) => {
let store;
try {
store = await webext.storage.managed.get();
} catch(ex) {
}
webext.storage.local.set({ cachedManagedStorage: store || {} });
};
return {