Skip to content

Commit 9542eca

Browse files
authored
accept changes to avoid double [[ ]]
solves #361
1 parent 02ecbfa commit 9542eca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

matlab/updatejsonpetfile.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,13 @@
454454
for f = 1:length(shouldBarray)
455455
if isfield(filemetadata,shouldBarray{f})
456456
if isscalar(filemetadata.(shouldBarray{f}))
457-
filemetadata.(shouldBarray{f}) = {filemetadata.(shouldBarray{f})};
458-
updated = 1;
457+
if ~iscell(filemetadata.(shouldBarray{f}))
458+
filemetadata.(shouldBarray{f}) = {filemetadata.(shouldBarray{f})};
459+
updated = 1;
460+
elseif isnumeric(filemetadata.(shouldBarray{f}){1})
461+
filemetadata.(shouldBarray{f}) = {filemetadata.(shouldBarray{f})};
462+
updated = 1;
463+
end
459464
elseif all(size(filemetadata.(shouldBarray{f})) == 1)
460465
if any(contains(filemetadata.(shouldBarray{f}),{'none'}))
461466
filemetadata.(shouldBarray{f}) = {filemetadata.(shouldBarray{f})};

0 commit comments

Comments
 (0)