Skip to content

Commit cd3ff74

Browse files
Pavel Yakimenkodianaafanador3
authored andcommitted
check class
1 parent 6353a8c commit cd3ff74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Realm/RLMObjectBase.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ id RLMObjectThaw(RLMObjectBase *obj) {
537537
}
538538

539539
id RLMValidatedValueForProperty(id object, NSString *key, NSString *className) {
540-
if (![[[object objectSchema] className] isEqualToString:className]) {
540+
if ([object isKindOfClass:[RLMObjectBase class]] && ![[[object objectSchema] className] isEqualToString:className]) {
541541
@throw RLMException(@"Invalid value: cannot initialize '%@' with value '%@'", className, object);
542542
}
543543
@try {

0 commit comments

Comments
 (0)