Guard against null prototype properties

Review URL: https://codereview.chromium.org//37853003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29122 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
sra@google.com 2013-10-23 20:56:36 +00:00
parent 1787f36d42
commit 3c4f43af68

View file

@ -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);
}
}
}
}