Index: sdk/lib/_internal/lib/native_helper.dart |
diff --git a/sdk/lib/_internal/lib/native_helper.dart b/sdk/lib/_internal/lib/native_helper.dart |
index 8592e917605e6f42770121f4d0ac3a60c343aaf6..b5f24ff70780cf145fb4c4d6964bf5025cd2c42b 100644 |
--- a/sdk/lib/_internal/lib/native_helper.dart |
+++ b/sdk/lib/_internal/lib/native_helper.dart |
@@ -327,10 +327,12 @@ void initNativeDispatch() { |
if (JS('bool', 'typeof (#[#]) == "function"', context, tag)) { |
var constructor = JS('', '#[#]', context, tag); |
var proto = JS('', '#.prototype', constructor); |
- var interceptorClass = JS('', '#[#]', map, tag); |
- var record = makeDefaultDispatchRecord(tag, interceptorClass, proto); |
- if (record != null) { |
- setDispatchProperty(proto, record); |
+ if (proto != null) { // E.g. window.mozRTCIceCandidate.prototype |
+ var interceptorClass = JS('', '#[#]', map, tag); |
+ var record = makeDefaultDispatchRecord(tag, interceptorClass, proto); |
+ if (record != null) { |
+ setDispatchProperty(proto, record); |
+ } |
} |
} |
} |