NullReferenceException throws on Windows when setting Cookies on .NET MAUI WebView
Root Cause
While setting a cookie in MAUI WebView, CoreWebView2 is null before the CoreWebView2Initialized event triggered.
Description of Change
Added the null condition for CoreWebView2 property while sync platform cookie method.
Issues Fixed
Fixes #18452
Validated the behaviour in the following platforms
- [x] Android
- [x] Windows
- [x] iOS
- [x] Mac
Output images
Before changes
After changes
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
I've reran the CI but I think this one might be causing some issues
UI tests are failing
and device tests are both crashing https://dev.azure.com/xamarin/public/_build/results?buildId=125725&view=results
Hi @PureWeen , We've checked and resolved the failed cases with the updated fix. The above test cases pass successfully. Could you please verify them once?
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/rebase
/rebase
/rebase
