From b5dae42421eb95c0d8072ae092159031dc5ad722 Mon Sep 17 00:00:00 2001 From: Benimautner Date: Wed, 2 Oct 2024 13:51:54 +0200 Subject: [PATCH] fix: added fix if user id is null --- lib/models/user.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/user.dart b/lib/models/user.dart index c4e519b..b34c629 100644 --- a/lib/models/user.dart +++ b/lib/models/user.dart @@ -106,7 +106,7 @@ class User { this.updated = updated ?? DateTime.now(); User.fromJson(Map json) - : id = json['id'], + : id = json.containsKey('id') ? json['id'] : 0, name = json.containsKey('name') ? json['name'] : '', username = json['username'], created = DateTime.parse(json['created']),