Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 144eb4c

Browse files
committed
fix(NodeAttrs): lazy init of observer listeners
1 parent 3d59a92 commit 144eb4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/core_dom/directive.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class NodeAttrs {
1616

1717
Map<String, List<AttributeChanged>> _observers;
1818

19-
Map<String, List<ObserverChanged>> _observerListeners = {};
19+
Map<String, List<ObserverChanged>> _observerListeners;
2020

2121
NodeAttrs(this.element);
2222

@@ -45,7 +45,8 @@ class NodeAttrs {
4545

4646
notifyFn(this[attributeName]);
4747

48-
if (_observerListeners.containsKey(attributeName)) {
48+
if (_observerListeners != null &&
49+
_observerListeners.containsKey(attributeName)) {
4950
_observerListeners[attributeName].forEach((cb) => cb(true));
5051
}
5152
}

0 commit comments

Comments
 (0)