diff --git a/frontend/src/components/Beneficiary.jsx b/frontend/src/components/Beneficiary.jsx
index e77dbbf..82fdc97 100755
--- a/frontend/src/components/Beneficiary.jsx
+++ b/frontend/src/components/Beneficiary.jsx
@@ -38,16 +38,29 @@ function Beneficiary() {
var will_beneficiary = await eth.contractWithSigner.wills(response[i].toNumber());
//console.log(response[i].toNumber());
- var withdrawdateNew = timeConverter(will_beneficiary.withdrawDate.toNumber());
-
- var myWill = {
- id: response[i].toNumber(),
- amount: ethers.utils.formatEther(will_beneficiary.amount),
- testator: will_beneficiary.testator,
- beneficiary: will_beneficiary.beneficiary,
- withdrawDate: withdrawdateNew
+ try{
+ var withdrawdateNew = timeConverter(will_beneficiary.withdrawDate.toNumber());
+ var myWill = {
+ id: response[i].toNumber(),
+ amount: ethers.utils.formatEther(will_beneficiary.amount),
+ testator: will_beneficiary.testator,
+ beneficiary: will_beneficiary.beneficiary,
+ withdrawDate: withdrawdateNew
+ }
}
- console.log(myWill)
+ catch(e) {
+ console.log("Invalid withdrawDate");
+ var myWill = {
+ id: response[i].toNumber(),
+ amount: ethers.utils.formatEther(will_beneficiary.amount),
+ testator: will_beneficiary.testator,
+ beneficiary: will_beneficiary.beneficiary,
+ withdrawDate: "Invalid withdrawDate: " + will_beneficiary.withdrawDate._hex
+ }
+
+ }
+
+ console.log(myWill)
myBeneficiary.push(myWill);
}
setwill_beneficiary(myBeneficiary);
diff --git a/frontend/src/components/CardBeneficiary.jsx b/frontend/src/components/CardBeneficiary.jsx
index 3d23da9..2261cd8 100755
--- a/frontend/src/components/CardBeneficiary.jsx
+++ b/frontend/src/components/CardBeneficiary.jsx
@@ -42,10 +42,13 @@ async function withdraw(){