Skip to content

Commit

Permalink
Merge pull request #5 from fireblocks/COR-69059-fix-outgoing-message-…
Browse files Browse the repository at this point in the history
…exception

fixing app crash
  • Loading branch information
AlonFireblocks authored Jun 18, 2024
2 parents 5c533ff + 78266b9 commit 77ebc66
Show file tree
Hide file tree
Showing 4 changed files with 14,036 additions and 11,211 deletions.
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ PODS:
- GoogleUtilities/Environment (~> 7.8)
- GoogleUtilities/UserDefaults (~> 7.8)
- PromisesObjC (~> 2.1)
- fireblocks-react-native-ncw-sdk (0.1.6):
- fireblocks-react-native-ncw-sdk (1.0.0):
- glog
- RCT-Folly (= 2022.05.16.00)
- React-Core
Expand Down Expand Up @@ -1545,7 +1545,7 @@ SPEC CHECKSUMS:
FirebaseCore: 28045c1560a2600d284b9c45a904fe322dc890b6
FirebaseCoreInternal: bca337352024b18424a61e478460547d46c4c753
FirebaseInstallations: 763814908793c0da14c18b3dcffdec71e29ed55e
fireblocks-react-native-ncw-sdk: 0909112e3197de435ad2e3667ce3a43b60c3a2d4
fireblocks-react-native-ncw-sdk: 867882b558c0a3ef1c7a79d2e21af7db40a5a88e
Flipper: c7a0093234c4bdd456e363f2f19b2e4b27652d44
Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
Expand Down Expand Up @@ -1626,4 +1626,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 39734b197bfc91ffdfa5baa43576530a5725c6dd

COCOAPODS: 1.14.3
COCOAPODS: 1.15.2
4 changes: 3 additions & 1 deletion ios/ReactNativeNcwSdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ class ReactNativeNcwSdk : RCTEventEmitter {
let status = instance.getKeysStatus()
var response: [String: Any] = [:]
for key in status {
response[key.algorithm.rawValue] = try key.asDictionary()
if let algorithm = key.algorithm?.rawValue {
response[algorithm] = try key.asDictionary()
}
}
resolve(response)
} catch let err {
Expand Down
6 changes: 3 additions & 3 deletions src/FireblocksNCWFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ function registerEvents({ messagesHandler, secureStorageProvider, eventsHandler,
console.error("outgoingMessage error", e);

if (e instanceof Error) {
await ReactNativeNcwSdk.handleResponse({ opId, deviceId, data: { error: e.message } });
await ReactNativeNcwSdk.handleResponse({ opId, deviceId, error: e.message });
} else if (e instanceof String || typeof e === 'string') {
await ReactNativeNcwSdk.handleResponse({ opId, deviceId, data: { error: e } });
await ReactNativeNcwSdk.handleResponse({ opId, deviceId, error: e });
} else {
await ReactNativeNcwSdk.handleResponse({ opId, deviceId, data: { error: "unkown error" } });
await ReactNativeNcwSdk.handleResponse({ opId, deviceId, error: "unkown error" });
}
}
}));
Expand Down
Loading

0 comments on commit 77ebc66

Please sign in to comment.