Skip to content

Commit c4b537a

Browse files
committed
added a fallback empty string when the parsed statusMessage is null
1 parent cca1913 commit c4b537a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/utils/riverpod/riverpod_providers/generated_providers/token_notifier.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,9 @@ class TokenNotifier extends _$TokenNotifier with ResultHandler {
670670
rolloutState: PushTokenRollOutState.sendRSAPublicKeyFailed,
671671
),
672672
);
673-
if (pushToken == null)
673+
if (pushToken == null) {
674674
Logger.warning('Tried to update a token that does not exist.');
675+
}
675676
return false;
676677
}
677678
}
@@ -958,8 +959,9 @@ class TokenNotifier extends _$TokenNotifier with ResultHandler {
958959
Future<bool> handleLink(Uri uri) async {
959960
final tokenResults = await TokenImportSchemeProcessor.processUriByAny(uri);
960961
if (tokenResults == null) return false; // Not a valid token link
961-
if (tokenResults.isEmpty)
962+
if (tokenResults.isEmpty) {
962963
return true; // Link was valid but contained no tokens
964+
}
963965
await handleProcessorResults(
964966
tokenResults,
965967
args: {'TokenOriginSourceType': TokenOriginSourceType.link},
@@ -1149,7 +1151,7 @@ class TokenNotifier extends _$TokenNotifier with ResultHandler {
11491151
if (statusMessage == null) {
11501152
try {
11511153
final String message = response.body.isNotEmpty
1152-
? (json.decode(response.body)['result']?['error']?['message'])
1154+
? (json.decode(response.body)['result']?['error']?['message'] ?? '')
11531155
: '';
11541156
statusMessage = StatusMessage(
11551157
message: (localization) =>

0 commit comments

Comments
 (0)