mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-04-13 00:00:10 +08:00
fix(ssr): fix window references
This commit is contained in:
@@ -26,7 +26,10 @@ export class IonicNativePlugin {
|
||||
* Returns the original plugin object
|
||||
*/
|
||||
static getPlugin(): any {
|
||||
return get(window, this.pluginRef);
|
||||
if (typeof window !== 'undefined') {
|
||||
return get(window, this.pluginRef);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user