Skip to content

Commit d3219c8

Browse files
committed
Check value is cell when setting SetDim labels
Fixes #115
1 parent 95a7a88 commit d3219c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

+nix/Dynamic.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ function set_method(obj, val)
2525

2626
if (isempty(val))
2727
nix_mx(strcat(obj.alias, '::set_none_', prop), obj.nix_handle, 0);
28-
elseif(strcmp(prop, 'units') && (~iscell(val)))
29-
%-- BUGFIX: Matlab crashes, if units in Tags and MultiTags
30-
%-- are set using anything else than a cell.
28+
elseif((strcmp(prop, 'units') || strcmp(prop, 'labels')) && (~iscell(val)))
29+
%-- BUGFIX: Matlab crashes, if units in Tags and MultiTags
30+
%-- or labels of SetDimension are set using anything else than a cell.
3131
ME = MException('MATLAB:class:SetProhibited', sprintf(...
32-
'Units can be only set by using cells.'));
32+
'This value only supports cells.'));
3333
throwAsCaller(ME);
3434
else
3535
nix_mx(strcat(obj.alias, '::set_', prop), obj.nix_handle, val);

0 commit comments

Comments
 (0)