Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix offscreen browser browser settings nullptr #1358

Conversation

illfang
Copy link
Contributor

@illfang illfang commented Oct 22, 2015

There is a bug with the optional browser settings in the offscreen browser project which will lead to a null poiinter exception if no settings are available.

Example:
https://github.com/illfang/CefSharp/tree/offscreen-browser-browser-settings-nullptr-test

System.NullReferenceException: Object reference not set to an instance of an object.
   at CefSharp.BrowserSettings.get_OffScreenTransparentBackground()
   at CefSharp.ManagedCefBrowserAdapter.CreateOffscreenBrowser(IntPtr windowHandle, BrowserSettings browserSettings, RequestContext requestContext, String address)
   at CefSharp.OffScreen.ChromiumWebBrowser.CreateBrowser(IntPtr windowHandle, String address, BrowserSettings browserSettings, RequestContext requestcontext)
   at CefSharp.OffScreen.ChromiumWebBrowser..ctor(String address, BrowserSettings browserSettings, RequestContext requestcontext, Boolean automaticallyCreateBrowser)

Probably related to dca52f9

I suggest two version to fix this. This is the first version which will always create the offscreen browser using the instance settings, request context and address. The instance browser settings are checked for null in the constructor.

The second solution is described in /pull/1359

I'm looking forward to your feedback. Feel free to close one of the PRs if you decide to merge one.

@amaitland
Copy link
Member

I think this is the cleanest approach. The changes in dca52f9 were only from a week ago, so they've never been released.

@amaitland amaitland added this to the 45.0.0 milestone Oct 22, 2015
@amaitland
Copy link
Member

Will need to be back ported into the cefsharp/43 branch.

amaitland added a commit that referenced this pull request Oct 22, 2015
…ettings-nullptr-interface-breaking

Fix offscreen browser browser settings nullptr (breaking current interface)
@amaitland amaitland merged commit f609484 into cefsharp:master Oct 22, 2015
@amaitland amaitland changed the title Fix offscreen browser browser settings nullptr (breaking current interface) Fix offscreen browser browser settings nullptr Oct 22, 2015
@amaitland amaitland modified the milestones: 43.0.1, 45.0.0 Oct 22, 2015
@amaitland
Copy link
Member

Setting milestone to 43.0.1 as that's the first release this change will appear in (even though it's merged initially into master).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants