Skip to content

Commit

Permalink
null check
Browse files Browse the repository at this point in the history
  • Loading branch information
Robiquet committed Feb 26, 2024
1 parent cce1c03 commit 5ca40b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pages/leaderboard/[period].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ export async function getStaticProps({ params }) {

const suspiciousActivity = marketTotal.baseAssetIn.eq(0);

if (market?.status === "Resolved" && !suspiciousActivity) {
if (
market?.status === "Resolved" &&
market.question &&
!suspiciousActivity
) {
const diff = marketTotal.baseAssetOut.minus(marketTotal.baseAssetIn);

const endTimestamp = market.period.end;
Expand All @@ -414,7 +418,7 @@ export async function getStaticProps({ params }) {
const usdProfitLoss = diff.mul(marketEndBaseAssetPrice ?? 0);

marketsSummary.push({
question: market.question!,
question: market.question,
marketId: market.marketId,
baseAssetId: parseAssetIdString(market.baseAsset) as BaseAssetId,
profit: usdProfitLoss.div(ZTG).toNumber(),
Expand Down

0 comments on commit 5ca40b0

Please sign in to comment.