Skip to content

Commit 9b501e4

Browse files
committed
Update amplifyuser.dart
1 parent e4b2284 commit 9b501e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/model/amplifyuser.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ class AmplifyUser {
2121
final response = utf8.decode(base64Url.decode(normalized));
2222

2323
var json = jsonDecode(response);
24-
groups = json['cognito:groups'];
25-
username = json['username'];
26-
deviceKey = json['device_key'];
27-
clientId = json['client_id'];
24+
groups = json['cognito:groups'] ?? [];
25+
username = json['username'] ?? "";
26+
deviceKey = json['device_key'] ?? "";
27+
clientId = json['client_id'] ?? "";
2828

2929
// check if the user is in the allowed groups
3030
for (var group in groups) {

0 commit comments

Comments
 (0)