CB-9150 Fix InAppBrowser executeScript crash on Windows if no data returned

This commit is contained in:
sgrebnov 2015-11-17 11:42:55 +03:00
parent 6b99fb96f8
commit 49757716f5

View File

@ -1,4 +1,4 @@
/* /*
* *
* Licensed to the Apache Software Foundation (ASF) under one * Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file * or more contributor license agreements. See the NOTICE file
@ -247,7 +247,8 @@ var IAB = {
if (isWebViewAvailable && browserWrap && popup) { if (isWebViewAvailable && browserWrap && popup) {
var op = popup.invokeScriptAsync("eval", code); var op = popup.invokeScriptAsync("eval", code);
op.oncomplete = function (e) { op.oncomplete = function (e) {
var result = [e.target.result]; // return null if event target is unavailable by some reason
var result = (e && e.target) ? [e.target.result] : [null];
hasCallback && win(result); hasCallback && win(result);
}; };
op.onerror = function () { }; op.onerror = function () { };