Skip to content

Commit 6d74d60

Browse files
Michael-Tajmajer-Emrsnamaitland
authored andcommitted
Add nullcheck to promiseData. This is null at times; I see it when refreshing the browser in the development tools.
1 parent acef4ab commit 6d74d60

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CefSharp.BrowserSubprocess.Core/Async/JavascriptAsyncMethodHandler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ namespace CefSharp
2727

2828
//this will create a promise and give us the reject/resolve functions {p: Promise, res: resolve(), rej: reject()}
2929
auto promiseData = promiseCreator->ExecuteFunctionWithContext(context, nullptr, CefV8ValueList());
30+
//when refreshing the browser this is sometimes null, in this case return
31+
if(nullptr == promiseData) return true;
32+
3033
retval = promiseData->GetValue("p");
3134

3235
auto resolve = promiseData->GetValue("res");

0 commit comments

Comments
 (0)