|
@@ -125,7 +125,9 @@ class Collection {
|
|
|
}
|
|
|
|
|
|
factory Collection.fromMap(Map<String, dynamic> map) {
|
|
|
- if (map == null) return null;
|
|
|
+ if (map == null) {
|
|
|
+ throw Exception('Argument is null');
|
|
|
+ }
|
|
|
final sharees = (map['sharees'] == null || map['sharees'].length == 0)
|
|
|
? <User>[]
|
|
|
: List<User>.from(map['sharees'].map((x) => User.fromMap(x)));
|
|
@@ -183,7 +185,9 @@ class CollectionAttributes {
|
|
|
}
|
|
|
|
|
|
factory CollectionAttributes.fromMap(Map<String, dynamic> map) {
|
|
|
- if (map == null) return null;
|
|
|
+ if (map == null) {
|
|
|
+ throw Exception('Argument is null');
|
|
|
+ }
|
|
|
|
|
|
return CollectionAttributes(
|
|
|
encryptedPath: map['encryptedPath'],
|
|
@@ -213,7 +217,9 @@ class User {
|
|
|
}
|
|
|
|
|
|
factory User.fromMap(Map<String, dynamic> map) {
|
|
|
- if (map == null) return null;
|
|
|
+ if (map == null) {
|
|
|
+ throw Exception('Argument is null');
|
|
|
+ }
|
|
|
|
|
|
return User(
|
|
|
id: map['id'],
|
|
@@ -253,7 +259,9 @@ class PublicURL {
|
|
|
}
|
|
|
|
|
|
factory PublicURL.fromMap(Map<String, dynamic> map) {
|
|
|
- if (map == null) return null;
|
|
|
+ if (map == null) {
|
|
|
+ throw Exception('Argument is null');
|
|
|
+ }
|
|
|
|
|
|
return PublicURL(
|
|
|
url: map['url'],
|