FAQ: Handling Optional Values in SwiftData #1
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noah/CompoundPredicate#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm getting a crash with the following error:

It looks like the issue is in the

currentRoomPredicate, if I remove it from theconjunctionarray it doesn't crash:Is there a limit on the allowed nested objects in the predicate? I mean is the problem with
contract.listing?.room?.persistentModelID?Thank you for the great work making this lib!
Thank you for the report :)
It might be an issue with
PersistentIdentifierorNilLiteral.Can you provide a minimal reproducible example?
I am trying to reproduce the issue and am getting a SwiftData crash when trying to access nested relationships:
This seems to be an issue with SwiftData. I suggest trying to try unwrapping the optionals:
I would welcome a minimal reproducible example as I am so far unable to reproduce this specific crash
Yes thanks, managed to solve it by reading this article: https://fatbobman.com/en/posts/how-to-handle-optional-values-in-swiftdata-predicates/
Happy to hear you could solve the issue. I'm closing it but marking it with FAQ for others with the same problem