on master help sign in
release: early-out if there is no linear batch

Continuing otherwise might get you read crashes on the other functions?

commit29f4a14869489481a950a1af53f583d751897444 authorfang <git@fang.io> dateMon 11 Jan 2021, 19:18 (6 years ago) parent085c1e2
1 file changed+5−1
src/lib/starRelease.js+5−1
src/lib/starRelease.js+5−1
@@ -114,9 +114,13 @@ export async function getConditional(contracts, address) {
114114}
115115
116116export async function getLinear(contracts, address) {
117+ const batch = await linearSR.getBatch(contracts, address);
118+ if (batch.amount === 0) {
119+ return { available: 0, withdrawn: 0, total: 0 };
120+ }
121+
117122 const remaining = (await linearSR.getRemainingStars(contracts, address))
118123 .length;
119− const batch = await linearSR.getBatch(contracts, address);
120124 const { amount, withdrawn } = batch;
121125
122126 const limit = await linearSR.getWithdrawLimit(contracts, address);