Skip to content

Commit 7593376

Browse files
Sertan SenturkSertan Senturk
authored andcommitted
Added object checker in savejson and saveubjson when omitting rootname
1 parent 98c9aad commit 7593376

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

savejson.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@
105105
rootisarray=0;
106106
rootlevel=1;
107107
forceroot=jsonopt('ForceRootName',0,opt);
108-
if((isnumeric(obj) || islogical(obj) || ischar(obj) || isstruct(obj) || iscell(obj)) && isempty(rootname) && forceroot==0)
108+
if((isnumeric(obj) || islogical(obj) || ischar(obj) || isstruct(obj) || ...
109+
iscell(obj) || isobject(obj)) && isempty(rootname) && forceroot==0)
109110
rootisarray=1;
110111
rootlevel=0;
111112
else

saveubjson.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
rootisarray=0;
9494
rootlevel=1;
9595
forceroot=jsonopt('ForceRootName',0,opt);
96-
if((isnumeric(obj) || islogical(obj) || ischar(obj) || isstruct(obj) || iscell(obj)) && isempty(rootname) && forceroot==0)
96+
if((isnumeric(obj) || islogical(obj) || ischar(obj) || isstruct(obj) || ...
97+
iscell(obj) || isobject(obj)) && isempty(rootname) && forceroot==0)
9798
rootisarray=1;
9899
rootlevel=0;
99100
else

0 commit comments

Comments
 (0)