cefsharp / CefSharp

.NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework
http://cefsharp.github.io/
Other
9.89k stars 2.92k forks source link

NullReferenceException from SchemeHandlerFactoryWrapper.Create #1790

Closed justin-caldicott closed 8 years ago

justin-caldicott commented 8 years ago

49.0.1 via NuGet.

x86

Win10

WinForms

Return null from a custom implementation of ISchemeHandlerFactory.Create

https://gist.github.com/justin-caldicott/c20bbd011c250d9f6d226d598cb2b9ff

This previously allowed default CEF handling to occur. We were using it for requests to third party services such as Mapbox.

It now throws a NullReferenceException.

Looks like it was broken in this commit: https://github.com/cefsharp/CefSharp/commit/12f42331dcd25135ff7ddf041a571b63bd32bde2#diff-e8faa1453883ff4c7ab38a74eac0b01eL40

When an if block was removed. It was OK in 47.0.2.

Adding back the if block, with just the return null, fixes it for me: https://github.com/bluebirdtech/CefSharp/commit/7a2d7896035dbaadf4ad26b48df99c3264651b16

Not tried it. I expect this fix to be straight forward to apply, but let me know if you need more detail.

amaitland commented 8 years ago

@justin-caldicott By all means submit a PR targeted against master

49.0.1 via NuGet.

For reference this version is no longer supported.

justin-caldicott commented 8 years ago

Thanks @amaitland I'll do that. Needed to patch 49.0.1 as we're not able to jump to .NET 4.5 just yet.

amaitland commented 8 years ago

No problem, you'll have to build your own packages.

justin-caldicott commented 8 years ago

That's fine I've done that already. Thanks for doing such a great job BTW building locally was very straight forward!

amaitland commented 8 years ago

Resolved with #1792