-
Notifications
You must be signed in to change notification settings - Fork 165
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
Realm.NET SDK 5.01 throws exception when filter returns null #2025
Comments
Seems more like a bug - I'll try to reproduce it and get back to you. If you have a small isolated project that exhibits this behavior, it'll speed things up. |
Sorry @nirinchev but the snippet is from a large project that jumps through lots of hoops to access the dataset, so not something I can easily tease out into a sample repo. |
What's the schema of the involved classes? I can't seem to be able to reproduce with a simple unit test. Also, what's the value for |
Thank you for giving this your attention @nirinchev
The property values of
In Realm Studio I can see that for OrderDetail 75edd946-2681-40a8-b83b-f1e66423c30a, Job is null The data is consistent with the design. |
Hm, this looks like the issue that was fixed here: https://github.com/realm/realm-core/blob/master/CHANGELOG.md#6025-release-notes. Unfortunately, .NET 5.0.1 is already running Core 6.0.25, which seems to indicate, it's a new undiscovered problem. |
So the realm file that exhibit this behavior, is that generated with SDK 5.01 or generated with SDK 4.3.0 and then upgraded? In any case it could be very helpful, if you could share a realm file that exposes this error. You can share it privately by sending it to [email protected]. |
@VagueGit Can you share the realm file? |
Address of Realm file emailed to @jedelbo |
Root cause found. We will release a fix as soon as possible. |
Still crashes in my UWP app with "External component has thrown an exception. (Exception = {"Error HRESULT E_FAIL has been returned from a call to a COM component."})" Edit: was testing NuGet v5.1.0 which has just been released and I therefore thought it included the fix |
This has been fixed in core but hasn't been released for .NET yet. |
I use RealmSwift on iOS, and when accessing a filtered |
@tipa is this fixed for you? Seems still not fixed on my app with 5.4.7 |
Also cc @VagueGit |
Jup, still crashing with Nuget 5.1.1 even though the changelog mentions bugfixes in Core |
@jedelbo could we reopen this issue and try to find a fix soon? It's causing 10% of my users experiencing crashes which is terrible :( |
Also, would use v10 fix the issue? https://github.com/realm/realm-cocoa/releases/tag/v10.0.0-rc.1 |
The exception is no longer thrown on the test database where we first struck the error. Thank you @nirinchev @jedelbo |
Well, I seem to have a unrelated problem then. I will try to create a repro and open a new issue. Seems like a threading issue that has been introduced with v5.x |
On Realm.NET SDK 5.01
Windows 10.0.19041
Visual Studio 2019 16.7.3
Realm Cloud v3.28.2
Running VS in Debug mode Realm.NET SDK Version 4.3.0 this snippet returns null when none found and allows a null check
On Realm.NET SDK Version 5.1.0 the line
Data.Job rJob = realm.All<Data.Job>().Filter(filter).FirstOrDefault();
throws an exception when rJob is null. The exception message is
OrderDetail.OrderDetailId
is the primary key and it is not nullrJob
is null so of course the primary key is nullHave I missed a breaking change?
Here is the stack trace
The text was updated successfully, but these errors were encountered: