Skip to content

Commit 45c8ba5

Browse files
chore: code reordering
1 parent bc6f621 commit 45c8ba5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/Web3Core/EthereumNetwork/Request/APIRequest+Methods.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ func checkError(method: String, error: JsonRpcErrorObject.RpcError) throws -> St
2222
}
2323

2424
func spelunkData(value: Any?) -> (message: String, data: String)? {
25+
if (value == nil) {
26+
return nil
27+
}
28+
2529
func spelunkRpcError(_ message: String, data: String) -> (message: String, data: String)? {
2630
if message.contains("revert") && data.isHex {
2731
return (message, data)
@@ -30,10 +34,6 @@ func spelunkData(value: Any?) -> (message: String, data: String)? {
3034
}
3135
}
3236

33-
if (value == nil) {
34-
return nil
35-
}
36-
3737
if let error = value as? JsonRpcErrorObject.RpcError {
3838
if let data = error.data as? String {
3939
return spelunkRpcError(error.message, data: data)

0 commit comments

Comments
 (0)