Commit 47e042ba authored by Ian Hickson's avatar Ian Hickson

Merge pull request #2477 from Hixie/semantics-assert

Assert binding ready before getting a11y listener
parents 1568b827 3d802075
......@@ -349,8 +349,10 @@ class SemanticsNode extends AbstractNode {
static bool get hasListeners => _listeners != null && _listeners.length > 0;
static VoidCallback onSemanticsEnabled; // set by the binding
static void addListener(mojom.SemanticsListener listener) {
if (!hasListeners)
if (!hasListeners) {
assert(onSemanticsEnabled != null); // initialise the binding _before_ adding listeners
onSemanticsEnabled();
}
_listeners ??= <mojom.SemanticsListener>[];
_listeners.add(listener);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment