fix(testability): properly throw when no testability available

This commit is contained in:
Michael Goderbauer 2015-08-14 18:43:47 -07:00 committed by Hank Duan
parent 296851797b
commit 841206c678
1 changed files with 3 additions and 1 deletions

View File

@ -114,7 +114,9 @@ class GetTestability {
object['getAngularTestability'] = _jsify((Element elem,
bool findInAncestors) {
var testability = registry.findTestabilityInTree(elem, findInAncestors);
return _jsify(new PublicTestability(testability));
return testability == null
? null
: _jsify(new PublicTestability(testability));
});
object['getAllAngularTestabilities'] = _jsify(() {
var publicTestabilities = registry