Restore old list property validation logic

This commit is contained in:
Thomas Goyne 2017-08-30 13:27:44 -07:00
parent cb9a3c9f76
commit 9c1b04f8e5
1 changed files with 10 additions and 3 deletions

View File

@ -355,12 +355,19 @@ inline bool Value<T>::is_valid_for_property(ContextType context, const ValueType
} }
if (realm::is_array(prop.type)) { if (realm::is_array(prop.type)) {
if (prop.type == PropertyType::Object) { if (prop.type != PropertyType::Object) {
return false;
}
// FIXME: Do we need to validate the types of the contained objects?
if (is_array(context, value)) {
return true;
}
if (is_object(context, value)) {
auto object = to_object(context, value); auto object = to_object(context, value);
return Object<T>::template is_instance<ResultsClass<T>>(context, object) return Object<T>::template is_instance<ResultsClass<T>>(context, object)
|| Object<T>::template is_instance<ListClass<T>>(context, object); || Object<T>::template is_instance<ListClass<T>>(context, object);
} else if (prop.type == PropertyType::LinkingObjects) {
return false;
} }
return false; return false;