fix: only throw on deserialize if kDebugMode is true (#2976)

This closes #2972, in debug mode we will still catch these issues but if
somehow that happens on production it will fallback to safe default
This commit is contained in:
cyan
2026-02-26 14:28:40 +02:00
committed by GitHub
parent ed00936fea
commit 64ded5a72b
6 changed files with 38 additions and 8 deletions
+5 -1
View File
@@ -1,4 +1,5 @@
import 'package:cw_core/transaction_priority.dart';
import 'package:flutter/foundation.dart';
class MoneroTransactionPriority extends TransactionPriority {
const MoneroTransactionPriority({required String title, required int raw})
@@ -30,7 +31,10 @@ class MoneroTransactionPriority extends TransactionPriority {
case 4:
return fastest;
default:
throw Exception('Unexpected token: $raw for MoneroTransactionPriority deserialize');
if (kDebugMode) {
throw Exception('Unexpected token: $raw for MoneroTransactionPriority deserialize');
}
return medium;
}
}