Skip to content
Snippets Groups Projects
Unverified Commit d76b032c authored by meskio's avatar meskio :tent:
Browse files

Don't crash if the member doesn't exist

Check for member existance before accesing internal values of the
member.
parent b19e9846
Branches
Tags
No related merge requests found
......@@ -41,15 +41,18 @@ function TransactionList() {
setTypes(newTypes);
};
let memberStr = "";
if (transaction.member) {
memberStr = transaction.member.name + " (" + transaction.member.num + ")";
}
const entries = transactions.map((transaction) => {
return (
<TransactionTr key={transaction.ID} transaction={transaction}>
<td>{icon(transaction)}</td>
<td>{printTransactionID(transaction)}</td>
<td>{printDate(transaction.date)}</td>
<td>
{transaction.member.name} ({transaction.member.num})
</td>
<td>{memberStr}</td>
<td>{transaction.proxy ? transaction.proxy.name : ""}</td>
<td>{printMoney(transaction.total) + ""}</td>
</TransactionTr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment