Skip to content

Commit

Permalink
Realm object fix for detached objects
Browse files Browse the repository at this point in the history
  • Loading branch information
evermeer committed Feb 13, 2018
1 parent b2f4fbb commit a9d2324
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion EVReflection.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "EVReflection"
s.version = "5.5.3"
s.version = "5.5.4"
s.summary = "Reflection based object mapping. (Dictionary, CKRecord, NSManagedObject, Realm, JSON, XML, Alamofire, Moya, RxSwift, ReactiveSwift)"

s.description = <<-EOS
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions Source/Realm/RealmObjectExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ extension Object {

// To make sure that we can get a value without crashing
override open func value(forUndefinedKey key: String) -> Any? {
if objectSchema.properties.map({$0.name}).contains(key) == true {
return super.value(forUndefinedKey: key)
}

return nil
}
}
Expand Down

0 comments on commit a9d2324

Please sign in to comment.