Committed by
GitHub
Merge pull request #627 from Hitsu91/master
RxList null check in the constructor
Showing
3 changed files
with
3 additions
and
3 deletions
@@ -11,7 +11,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | @@ -11,7 +11,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | ||
11 | /// Create a list similar to `List<T>` | 11 | /// Create a list similar to `List<T>` |
12 | class RxList<E> implements List<E>, RxInterface<List<E>> { | 12 | class RxList<E> implements List<E>, RxInterface<List<E>> { |
13 | RxList([List<E> initial]) { | 13 | RxList([List<E> initial]) { |
14 | - _list = initial; | 14 | + if (initial != null) _list = initial; |
15 | } | 15 | } |
16 | 16 | ||
17 | List<E> _list = <E>[]; | 17 | List<E> _list = <E>[]; |
@@ -9,7 +9,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | @@ -9,7 +9,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | ||
9 | 9 | ||
10 | class RxMap<K, V> implements RxInterface<Map<K, V>>, Map<K, V> { | 10 | class RxMap<K, V> implements RxInterface<Map<K, V>>, Map<K, V> { |
11 | RxMap([Map<K, V> initial]) { | 11 | RxMap([Map<K, V> initial]) { |
12 | - _value = initial; | 12 | + if (initial != null) _value = initial; |
13 | } | 13 | } |
14 | 14 | ||
15 | @override | 15 | @override |
@@ -9,7 +9,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | @@ -9,7 +9,7 @@ import '../rx_typedefs/rx_typedefs.dart'; | ||
9 | 9 | ||
10 | class RxSet<E> implements Set<E>, RxInterface<Set<E>> { | 10 | class RxSet<E> implements Set<E>, RxInterface<Set<E>> { |
11 | RxSet([Set<E> initial]) { | 11 | RxSet([Set<E> initial]) { |
12 | - _set = initial; | 12 | + if (initial != null) _set = initial; |
13 | } | 13 | } |
14 | 14 | ||
15 | Set<E> _set = <E>{}; | 15 | Set<E> _set = <E>{}; |
-
Please register or login to post a comment