Skip to content

Commit 14ef80f

Browse files
committed
Update electrum_api_provider.dart
1 parent 8334cdd commit 14ef80f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/provider/api_provider/electrum_api_provider.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ class ElectrumApiProvider {
2222
dynamic _findResult(
2323
Map<String, dynamic> data, ElectrumRequestDetails request) {
2424
if (data["error"] != null) {
25-
final code = int.parse(((data["error"]?['code']?.toString()) ?? "0"));
25+
final code =
26+
int.tryParse(((data["error"]?['code']?.toString()) ?? "0")) ?? 0;
2627
final message = data["error"]?['message'] ?? "";
2728
throw RPCError(
2829
errorCode: code,

0 commit comments

Comments
 (0)