Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Unified Diff: sdk/lib/_internal/lib/native_helper.dart

Issue 37853003: Guard against null prototype properties (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ }
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698