From c53b136dbe7ed7fc0fc298593f8b677a66c77910 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Wed, 29 Apr 2020 13:13:28 -0400 Subject: [PATCH] fix(all): use proper undefined check when using Haptics plugin (#21156) fixes #21148 --- core/src/utils/native/haptic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/utils/native/haptic.ts b/core/src/utils/native/haptic.ts index d95505ba1d..46b064feb1 100644 --- a/core/src/utils/native/haptic.ts +++ b/core/src/utils/native/haptic.ts @@ -10,7 +10,7 @@ interface HapticNotificationOptions { const HapticEngine = { getEngine() { const win = (window as any); - return (win.TapticEngine) || (win.Capacitor && win.Capacitor.Plugins.Haptics); + return (win.TapticEngine) || (win.Capacitor && win.Capacitor.isPluginAvailable('Haptics') && win.Capacitor.Plugins.Haptics); }, available() { return !!this.getEngine();