mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 12:59:21 +00:00
Fix empty fields
This commit is contained in:
parent
519c68b092
commit
8f0f50d0e4
@ -238,7 +238,7 @@ class GroupsHelper {
|
||||
registrationLevel:
|
||||
_APIGroupsRegistrationLevelsMap[map["registration_level"]],
|
||||
postCreationLevel: _APIGroupsPostsCreationLevelsMap[map["posts_level"]],
|
||||
virtualDirectory: map["virtual_directory"],
|
||||
virtualDirectory: nullToEmpty(map["virtual_directory"]),
|
||||
following: map["following"]);
|
||||
}
|
||||
|
||||
@ -254,11 +254,11 @@ class GroupsHelper {
|
||||
registrationLevel:
|
||||
_APIGroupsRegistrationLevelsMap[map["registration_level"]],
|
||||
postCreationLevel: _APIGroupsPostsCreationLevelsMap[map["posts_level"]],
|
||||
virtualDirectory: map["virtual_directory"],
|
||||
virtualDirectory: nullToEmpty(map["virtual_directory"]),
|
||||
following: map["following"],
|
||||
timeCreate: map["time_create"],
|
||||
description: map["description"],
|
||||
url: map["url"] == "null" ? "" : map["url"],
|
||||
url: nullToEmpty(map["url"]),
|
||||
likes: map["number_likes"],
|
||||
userLike: map["is_liking"],
|
||||
);
|
||||
|
@ -4,3 +4,7 @@
|
||||
|
||||
/// Casting helper
|
||||
T cast<T>(dynamic val) => val is T ? val : null;
|
||||
|
||||
/// Turn null and "null" into ""
|
||||
String nullToEmpty(String input) =>
|
||||
input == null || input == "null" ? "" : input;
|
||||
|
Loading…
Reference in New Issue
Block a user