Skip to content

Commit

Permalink
fix(testability): properly throw when no testability available
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored and hankduan committed Aug 16, 2015
1 parent 2968517 commit 841206c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/angular2/src/core/testability/get_testability.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 841206c

Please sign in to comment.