Skip to content

Commit 7d8d15c

Browse files
committed
Core - JavascriptObjectRepository.ResolveObject incorrectly called with args.ObjectName of string.Empty
We were incorrectly leaving empty entries in the CefListValue Resolves #3193
1 parent 6dfad90 commit 7d8d15c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CefSharp.BrowserSubprocess.Core/BindObjectAsyncHandler.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ namespace CefSharp
4949
try
5050
{
5151
auto params = CefListValue::Create();
52+
//We need to store a seperate index into our params as
53+
//there are instances we skip over already cached objects
54+
//and end up with empty strings in the list.
55+
//e.g. first object is already bound/cached, we previously
56+
//second object isn't we end up with a list of "", "secondObject"
57+
int paramsIndex = 0;
5258

5359
auto boundObjectRequired = false;
5460
auto notifyIfAlreadyBound = false;
@@ -95,7 +101,7 @@ namespace CefSharp
95101
{
96102
//If no matching object found then we'll add the object name to the list
97103
boundObjectRequired = true;
98-
params->SetString(i, objectName);
104+
params->SetString(paramsIndex++, objectName);
99105

100106
JavascriptObject^ obj;
101107
if (_javascriptObjects->TryGetValue(managedObjectName, obj))

0 commit comments

Comments
 (0)