Skip to content

Commit 2335498

Browse files
authored
Attribute access patch (#36)
* Fix attribute access * sub ref update
1 parent eeaca6c commit 2335498

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/util/shared/record-display-helper.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ export function postProcessRecord(record: any, attributes: Attribute[]) {
2323

2424
export function postProcessAttributes(attributes: Attribute[]) {
2525
const prepareAttributes = jsonCopy(attributes);
26-
if (!attributes[0].hasOwnProperty('key')) {
27-
prepareAttributes.forEach((attribute, index) => {
28-
if (attribute.id !== null) {
29-
attribute.key = attribute.id;
30-
} else {
31-
throw new Error("Cant find attribute id in attribute object");
32-
}
33-
});
26+
if (attributes && attributes.length > 0) {
27+
if (!attributes[0].hasOwnProperty('key')) {
28+
prepareAttributes.forEach((attribute, index) => {
29+
if (attribute.id !== null) {
30+
attribute.key = attribute.id;
31+
} else {
32+
throw new Error("Cant find attribute id in attribute object");
33+
}
34+
});
35+
}
3436
}
3537
return prepareAttributes;
3638
}

submodules/javascript-functions

submodules/tailwind-config

0 commit comments

Comments
 (0)