From 855be555dd91133237518fc87ac4a980a8d74b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20=C4=8Eurech?= Date: Mon, 30 Aug 2021 14:26:48 +0200 Subject: [PATCH] Fix #66: Wrong PowerAuthError type check --- demoapp/ios/Podfile.lock | 16 ++++++++-------- demoapp/package-lock.json | 4 ++-- lib/internal/NativeWrapper.js | 2 +- src/internal/NativeWrapper.ts | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/demoapp/ios/Podfile.lock b/demoapp/ios/Podfile.lock index 3fba928..3b1186a 100644 --- a/demoapp/ios/Podfile.lock +++ b/demoapp/ios/Podfile.lock @@ -49,9 +49,9 @@ PODS: - React-jsi (= 0.64.1) - ReactCommon/turbomodule/core (= 0.64.1) - glog (0.3.5) - - PowerAuth2 (1.6.0): - - PowerAuthCore (~> 1.6.0) - - PowerAuthCore (1.6.0) + - PowerAuth2 (1.6.1): + - PowerAuthCore (~> 1.6.1) + - PowerAuthCore (1.6.1) - RCT-Folly (2020.01.13.00): - boost-for-react-native - DoubleConversion @@ -246,7 +246,7 @@ PODS: - React-perflogger (= 0.64.1) - React-jsinspector (0.64.1) - react-native-powerauth-mobile-sdk (1.5.2): - - PowerAuth2 (= 1.6.0) + - PowerAuth2 (= 1.6.1) - React - React-perflogger (0.64.1) - React-RCTActionSheet (0.64.1): @@ -546,8 +546,8 @@ SPEC CHECKSUMS: FBLazyVector: 7b423f9e248eae65987838148c36eec1dbfe0b53 FBReactNativeSpec: ac3a40ec4c5acbc6dd2d59e8a368f0c251e325ee glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62 - PowerAuth2: 9a3ba5fe163fad011a702ece1c20bc4767ee9607 - PowerAuthCore: 0a97050bfa8c37de86e497fab3c2f41da45deddb + PowerAuth2: 7483fd55abab153a89b9cb5aff05ffe8e64495fa + PowerAuthCore: 09fe7958d744024e33e0bbad5b6fc2c49c88e08f RCT-Folly: ec7a233ccc97cc556cf7237f0db1ff65b986f27c RCTRequired: ec2ebc96b7bfba3ca5c32740f5a0c6a014a274d2 RCTTypeSafety: 22567f31e67c3e088c7ac23ea46ab6d4779c0ea5 @@ -559,7 +559,7 @@ SPEC CHECKSUMS: React-jsi: 5de8204706bd872b78ea646aee5d2561ca1214b6 React-jsiexecutor: 124e8f99992490d0d13e0649d950d3e1aae06fe9 React-jsinspector: 500a59626037be5b3b3d89c5151bc3baa9abf1a9 - react-native-powerauth-mobile-sdk: c7c26d56a85d6957f8f718ce15f58a29c2c7c658 + react-native-powerauth-mobile-sdk: 2e885b2ac3670c3dc28910ebc0554157ecd9d8e2 React-perflogger: aad6d4b4a267936b3667260d1f649b6f6069a675 React-RCTActionSheet: fc376be462c9c8d6ad82c0905442fd77f82a9d2a React-RCTAnimation: ba0a1c3a2738be224a08092fa7f1b444ab77d309 @@ -592,4 +592,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: df5bb7404879325bfaead6be3b9567b6d93e10c4 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.2 diff --git a/demoapp/package-lock.json b/demoapp/package-lock.json index dee531f..7a39b29 100644 --- a/demoapp/package-lock.json +++ b/demoapp/package-lock.json @@ -15098,7 +15098,7 @@ "node_modules/react-native-powerauth-mobile-sdk": { "version": "1.5.2", "resolved": "file:../react-native-powerauth-mobile-sdk-1.5.2.tgz", - "integrity": "sha512-9VIc8VtuYrczwdD4mwi+Dy7OHuncL0Z8/SJ0xQ8XKk4HHYqSo6Xd4K0OB/mGTLNoECrLCNQxqTbnDSw1XKlDig==", + "integrity": "sha512-zPYOXHwOUV1HucxAdMvXo5VdLpDdkAMApA1c2KXbVGGtmww06JEX4zoTdEpG1uWuzqfmYM7PQuVPCs7ooBSGhg==", "license": "Apache 2.0", "dependencies": { "node-fetch": ">=2.6.1" @@ -31068,7 +31068,7 @@ }, "react-native-powerauth-mobile-sdk": { "version": "file:../react-native-powerauth-mobile-sdk-1.5.2.tgz", - "integrity": "sha512-9VIc8VtuYrczwdD4mwi+Dy7OHuncL0Z8/SJ0xQ8XKk4HHYqSo6Xd4K0OB/mGTLNoECrLCNQxqTbnDSw1XKlDig==", + "integrity": "sha512-zPYOXHwOUV1HucxAdMvXo5VdLpDdkAMApA1c2KXbVGGtmww06JEX4zoTdEpG1uWuzqfmYM7PQuVPCs7ooBSGhg==", "requires": { "node-fetch": ">=2.6.1" }, diff --git a/lib/internal/NativeWrapper.js b/lib/internal/NativeWrapper.js index e355462..9a3c47b 100644 --- a/lib/internal/NativeWrapper.js +++ b/lib/internal/NativeWrapper.js @@ -146,7 +146,7 @@ var __NativeWrapper = /** @class */ (function () { if (exception == null) { return new PowerAuthError(null, message !== null && message !== void 0 ? message : "Operation failed with unspecified error"); } - else if (exception) { + else if (exception instanceof PowerAuthError) { // There's no additional message, we can return exception as it is. if (message == null) { return exception; diff --git a/src/internal/NativeWrapper.ts b/src/internal/NativeWrapper.ts index 1ee3597..4c728a5 100644 --- a/src/internal/NativeWrapper.ts +++ b/src/internal/NativeWrapper.ts @@ -55,7 +55,7 @@ export class __NativeWrapper { // - Check if the exception is already PowerAuthError type. If so, then return the same instance. if (exception == null) { return new PowerAuthError(null, message ?? "Operation failed with unspecified error") - } else if (exception as PowerAuthError) { + } else if (exception instanceof PowerAuthError) { // There's no additional message, we can return exception as it is. if (message == null) { return exception