*Add more safety checks on window
This commit is contained in:
parent
648951208c
commit
200221e742
10
src/index.ts
10
src/index.ts
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue