Add nullcheck to promiseData. This is null at times; I see it when refreshing the browser in the development tools.

This commit is contained in:
mtajmajer
2018-07-07 11:19:02 -05:00
committed by amaitland
parent 709645a195
commit 8fb47b4761
@@ -27,6 +27,9 @@ namespace CefSharp
//this will create a promise and give us the reject/resolve functions {p: Promise, res: resolve(), rej: reject()}
auto promiseData = promiseCreator->ExecuteFunctionWithContext(context, nullptr, CefV8ValueList());
//when refreshing the browser this is sometimes null, in this case return
if(nullptr == promiseData) return true;
retval = promiseData->GetValue("p");
auto resolve = promiseData->GetValue("res");