Skip to content

Commit

Permalink
Fixed label template error if invalid extra field
Browse files Browse the repository at this point in the history
  • Loading branch information
Donkie committed Aug 7, 2024
1 parent 10ad8ce commit ae26bf5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/src/pages/printing/printing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ function getTagValue(tag: string, obj: GenericObject): any {
// Split tag by .
const tagParts = tag.split(".");
if (tagParts[0] === "extra") {
return JSON.parse(obj.extra[tagParts[1]]);
const extraValue = obj.extra[tagParts[1]];
if (extraValue === undefined) {
return "?";
}
return JSON.parse(extraValue);
}

const value = obj[tagParts[0]] ?? "?";
Expand Down

0 comments on commit ae26bf5

Please sign in to comment.