Skip to content

Commit 529d9ec

Browse files
authored
nil coalescing
1 parent df358d4 commit 529d9ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/web3swift/HookedFunctions/Web3+BrowserFunctions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ extension web3.BrowserFunctions {
8181
var transactionOptions = TransactionOptions()
8282
transactionOptions.from = options.from
8383
transactionOptions.to = options.to
84-
transactionOptions.value = options.value != nil ? options.value! : BigUInt(0)
84+
transactionOptions.value = options.value ?? 0
8585
transactionOptions.gasLimit = options.gasLimit != nil ? options.gasLimit! : .automatic
8686
transactionOptions.gasPrice = options.gasPrice != nil ? options.gasPrice! : .automatic
8787
return self.sendTransaction(transaction, transactionOptions: transactionOptions, password: password)

0 commit comments

Comments
 (0)