From d5919d17366f75febaa9070ad2c4f28569bbbd6a Mon Sep 17 00:00:00 2001 From: Elias Boukamza Date: Wed, 17 May 2017 12:45:54 +0200 Subject: [PATCH] fix(secure-storage): reject the promise if the plugin doesn't exist (#1562) --- src/@ionic-native/plugins/secure-storage/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/@ionic-native/plugins/secure-storage/index.ts b/src/@ionic-native/plugins/secure-storage/index.ts index ab7a5b99f..284b70a89 100644 --- a/src/@ionic-native/plugins/secure-storage/index.ts +++ b/src/@ionic-native/plugins/secure-storage/index.ts @@ -8,7 +8,7 @@ declare var cordova: any; */ export class SecureStorageObject { - constructor(private _objectInstance?: any) { } + constructor(private _objectInstance: any) { } /** * Gets a stored item @@ -125,7 +125,7 @@ export class SecureStorage extends IonicNativePlugin { if (checkAvailability('cordova.plugins.SecureStorage', null, 'SecureStorage') === true) { const instance = new cordova.plugins.SecureStorage(() => res(new SecureStorageObject(instance)), rej, store); } else { - res(new SecureStorageObject()); + rej('SecureStorage failure: cordova plugin is not available'); } }); }