*Add more safety checks on window

This commit is contained in:
Derrick Hammer 2022-07-20 17:23:48 -04:00
parent 648951208c
commit 200221e742
1 changed files with 5 additions and 5 deletions

View File

@ -15,12 +15,12 @@ const DHT_MODULE = "AQD1IgE4lTZkq1fqdoYGojKRNrSk0YQ_wrHbRtIiHDrnow";
let callModule: typeof callModuleModule, let callModule: typeof callModuleModule,
connectModule: typeof connectModuleModule; connectModule: typeof connectModuleModule;
if (window.document) { if (typeof window !== "undefined" && window?.document) {
callModule = callModuleKernel; callModule = callModuleKernel;
connectModule = connectModuleKernel; connectModule = connectModuleKernel;
} else { } else {
callModule = callModuleModule; callModule = callModuleModule;
connectModule = connectModuleModule; connectModule = connectModuleModule;
} }
export class DHT { export class DHT {