We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4b2284 commit 9b501e4Copy full SHA for 9b501e4
lib/model/amplifyuser.dart
@@ -21,10 +21,10 @@ class AmplifyUser {
21
final response = utf8.decode(base64Url.decode(normalized));
22
23
var json = jsonDecode(response);
24
- groups = json['cognito:groups'];
25
- username = json['username'];
26
- deviceKey = json['device_key'];
27
- clientId = json['client_id'];
+ groups = json['cognito:groups'] ?? [];
+ username = json['username'] ?? "";
+ deviceKey = json['device_key'] ?? "";
+ clientId = json['client_id'] ?? "";
28
29
// check if the user is in the allowed groups
30
for (var group in groups) {
0 commit comments