From 144eb4c76598a73a251477efc91c1460f5052937 Mon Sep 17 00:00:00 2001 From: Victor <victor@suumit.com> Date: Mon, 17 Mar 2014 09:53:19 +0100 Subject: [PATCH] fix(NodeAttrs): lazy init of observer listeners --- lib/core_dom/directive.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core_dom/directive.dart b/lib/core_dom/directive.dart index 720a8701d..1bc5507cf 100644 --- a/lib/core_dom/directive.dart +++ b/lib/core_dom/directive.dart @@ -16,7 +16,7 @@ class NodeAttrs { Map<String, List<AttributeChanged>> _observers; - Map<String, List<ObserverChanged>> _observerListeners = {}; + Map<String, List<ObserverChanged>> _observerListeners; NodeAttrs(this.element); @@ -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)); } }