@@ -11,6 +11,8 @@ function mustBeListOfUniqueItems(value)
1111% Note: If input is a list of typed metadata instances, equality is
1212% determined by comparing the identifiers of the instances.
1313
14+ if isempty(value ); return ; end
15+
1416 if openminds .utility .isMixedInstance(value )
1517 value = arrayfun(@(v ) v .Instance , value , ' uni' , 0 );
1618 instanceTypes = cellfun(@(v ) class(v ), value , ' UniformOutput' , 0 );
@@ -45,11 +47,11 @@ function assertUniqueInstances(instances)
4547 instanceIdentifiers = {instances .id };
4648 assert(isequal(instanceIdentifiers , unique(instanceIdentifiers , ' stable' )), ...
4749 ' OPENMINDS_MATLAB:PropertyValidator:InstancesMustBeUnique' , ...
48- ' Property value must be an array of unique items ' );
50+ ' Value must be an array of unique instances ' );
4951end
5052
5153function assertUniqueValues(values )
5254 assert(isequaln(sort(values ), unique(values )), ...
5355 ' OPENMINDS_MATLAB:PropertyValidator:ValuesMustBeUnique' , ...
54- ' Property value must be an array of unique items ' );
56+ ' Value must be an array of unique elements ' );
5557end
0 commit comments