[6.0.1] Microsoft.Data.Sqlite: Handle more nulls in ApplicationDataHelper #26637
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In 6.0, we enabled our UWP code for detecting the temp and data directory to work on the new
net5.0-windows
(and 6.0) TFMs. For some reason on .NET Core 3.1, this also causesGetType("Windows.Storage.ApplicationData")
to return non-null now butGetProperty("LocalFolder")
to return null leading to a NullReferenceException.Fixes #26574
Customer impact
Because this code runs during static initialization of the ADO.NET connection type it is impossible to work around this issue making it impossible to use the 6.0.0 version of Microsoft.Data.Sqlite on .NET Core 3.1 on Windows.
Regression?
Yes, from 5.0.
Risk
Low. The new handling of
null
results in the same code path that has been used for several releases.Verification. Manually verified that the library can be used on .NET Core 3.1. Our automated tests only execute on the latest runtime.