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

Commit

Permalink
fix(NodeAttrs): lazy init of observer listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Mar 17, 2014
1 parent 3d59a92 commit 144eb4c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/core_dom/directive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class NodeAttrs {

Map<String, List<AttributeChanged>> _observers;

Map<String, List<ObserverChanged>> _observerListeners = {};
Map<String, List<ObserverChanged>> _observerListeners;

NodeAttrs(this.element);

Expand Down Expand Up @@ -45,7 +45,8 @@ class NodeAttrs {

notifyFn(this[attributeName]);

if (_observerListeners.containsKey(attributeName)) {
if (_observerListeners != null &&
_observerListeners.containsKey(attributeName)) {
_observerListeners[attributeName].forEach((cb) => cb(true));
}
}
Expand Down

0 comments on commit 144eb4c

Please sign in to comment.