Skip to content

Commit c5c01db

Browse files
committed
[bug] test index before assuming it is string
1 parent ba581f5 commit c5c01db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jdict.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,15 @@
522522
else
523523
onekey = idx.subs;
524524
end
525-
escapedonekey = esckey_(onekey);
526525
if (ischar(onekey) && ~isempty(onekey))
526+
escapedonekey = esckey_(onekey);
527527
if (onekey(1) ~= char(36))
528528
temppath = [temppath '.' escapedonekey];
529529
else
530530
temppath = escapedonekey;
531531
end
532+
elseif (isnumeric(onekey))
533+
temppath = [temppath '[' num2str(onekey - 1) ']'];
532534
end
533535
end
534536
end

0 commit comments

Comments
 (0)