mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
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:
@@ -1,5 +1,6 @@
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cw_core/enumerable_item.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class ListOrderMode extends EnumerableItem<int> with Serializable<int> {
|
||||
const ListOrderMode({required String title, required int raw}) : super(title: title, raw: raw);
|
||||
@@ -16,7 +17,10 @@ class ListOrderMode extends EnumerableItem<int> with Serializable<int> {
|
||||
case 1:
|
||||
return descending;
|
||||
default:
|
||||
throw Exception('Unexpected token: $raw for ListOrderMode deserialize');
|
||||
if (kDebugMode) {
|
||||
throw Exception('Unexpected token: $raw for ListOrderMode deserialize');
|
||||
}
|
||||
return descending;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user