Skip to content

Commit

Permalink
Merge pull request #2288 from cesarvarela/fix-cset-tool-2286
Browse files Browse the repository at this point in the history
Prevent cset tool from crashing if the classification is missing attributes.
  • Loading branch information
kepae authored Sep 14, 2023
2 parents e5dd230 + 1424355 commit 69d8ad4
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ const ToolPage = (props) => {
};

for (const classification of data.classifications) {
const json = classification.attributes.find(
(a) => a.short_name == attribute.short_name
).value_json;
const item = classification.attributes.find((a) => a.short_name == attribute.short_name);

const value = JSON.parse(json);
if (item) {
const value = JSON.parse(item.value_json);

row[classification.namespace] = value;
row[classification.namespace] = value;
} else {
row[classification.namespace] = null;
}
}

rows.push(row);
Expand Down

0 comments on commit 69d8ad4

Please sign in to comment.