From 841206c6784e023ef9042976ef546e0331316ba6 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Fri, 14 Aug 2015 18:43:47 -0700 Subject: [PATCH] fix(testability): properly throw when no testability available --- modules/angular2/src/core/testability/get_testability.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/angular2/src/core/testability/get_testability.dart b/modules/angular2/src/core/testability/get_testability.dart index 923f7a7c6e..bfe3375083 100644 --- a/modules/angular2/src/core/testability/get_testability.dart +++ b/modules/angular2/src/core/testability/get_testability.dart @@ -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