Skip to content

Commit 97def7b

Browse files
fix: used short notation for null checking
1 parent ccae14f commit 97def7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Web3Core/KeystoreManager/BIP32Keystore.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public class BIP32Keystore: AbstractKeystore {
162162

163163
public func createNewCustomChildAccount(password: String, path: String) throws {
164164
guard let decryptedRootNode = try getPrefixNodeData(password),
165-
keystoreParams != nil else {
165+
let keystoreParams else {
166166
throw AbstractKeystoreError.encryptionError("Failed to decrypt a keystore")
167167
}
168168
guard let rootNode = HDNode(decryptedRootNode) else {
@@ -203,7 +203,7 @@ public class BIP32Keystore: AbstractKeystore {
203203
guard let serializedRootNode = rootNode.serialize(serializePublic: false) else {
204204
throw AbstractKeystoreError.keyDerivationError
205205
}
206-
try encryptDataToStorage(password, data: serializedRootNode, aesMode: self.keystoreParams!.crypto.cipher)
206+
try encryptDataToStorage(password, data: serializedRootNode, aesMode: keystoreParams.crypto.cipher)
207207
}
208208

209209
/// Fast generation addresses for current account

0 commit comments

Comments
 (0)