From 49757716f556c7c87713f2f81469ab394c887b12 Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Tue, 17 Nov 2015 11:42:55 +0300 Subject: [PATCH] CB-9150 Fix InAppBrowser executeScript crash on Windows if no data returned --- src/windows/InAppBrowserProxy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/windows/InAppBrowserProxy.js b/src/windows/InAppBrowserProxy.js index 817516e..fc037bd 100644 --- a/src/windows/InAppBrowserProxy.js +++ b/src/windows/InAppBrowserProxy.js @@ -1,4 +1,4 @@ -/* +/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -247,7 +247,8 @@ var IAB = { if (isWebViewAvailable && browserWrap && popup) { var op = popup.invokeScriptAsync("eval", code); 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); }; op.onerror = function () { };