Check for module existence

This commit is contained in:
Jiiks 2018-08-09 13:09:35 +03:00
parent 75ceee5449
commit 983763c48d
1 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,9 @@ export default new class E2EE extends BuiltinModule {
enabled(e) { enabled(e) {
if (Patcher.getPatchesByCaller('BD:TrackingProtection').length) return; if (Patcher.getPatchesByCaller('BD:TrackingProtection').length) return;
MonkeyPatch('BD:TrackingProtection', WebpackModules.getModuleByProps(['track'])).instead('track', this.track); const trackingModule = WebpackModules.getModuleByProps(['track']);
if (!trackingModule) return; // TODO Log it
MonkeyPatch('BD:TrackingProtection', trackingModule).instead('track', this.track);
} }
disabled(e) { disabled(e) {