Skip to content

Commit 4848b2d

Browse files
committed
[bug] let getattr return the attribute of the current item
1 parent e1c21b3 commit 4848b2d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

jdict.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,11 @@
575575

576576
function val = getattr(obj, jsonpath, attrname)
577577
if (nargin == 1)
578-
val = keys(obj.attr);
578+
if (isKey(obj.attr, obj.currentpath))
579+
val = keys(obj.attr(obj.currentpath));
580+
else
581+
val = [];
582+
end
579583
return
580584
end
581585
if (nargin == 2)

0 commit comments

Comments
 (0)