Skip to content
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

Fix a crash caused by UUID properties #26

Merged
merged 3 commits into from
Mar 1, 2024
Merged

Fix a crash caused by UUID properties #26

merged 3 commits into from
Mar 1, 2024

Conversation

ftchirou
Copy link
Owner

@ftchirou ftchirou commented Mar 1, 2024

  • Previously, a predicate such as \Note.id == UUID() (where id is of type UUID) would cause a crash. This is now fixed.
  • This PR also adds a tiny improvement. The == operator would previously not work when comparing Identifiable objects if the left hand side was an optional. This is fixed as well. It's now possible to do this 👇
class Note: NSManagedObject {
  @NSManaged var attachment: Attachment?
}

class Attachment: NSManagedObject, Identifiable {
  @NSManaged var id: String
  ...
}

let attachment: Attachment = // ...
let predicate = \Note.attachment == attachment

@ftchirou ftchirou merged commit 3bb2639 into main Mar 1, 2024
1 check passed
@ftchirou ftchirou deleted the fix/bugs branch March 1, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant