Skip to content

Commit

Permalink
don't break when mayor winner is not set (yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-luger committed Apr 19, 2024
1 parent bd525de commit 29983cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/PriceGraph/BazaarPriceGraph/BazaarPriceGraph.tsx
Expand Up @@ -133,7 +133,8 @@ function BazaarPriceGraph(props: Props) {
setChartData(prices, mayorData)
setIsLoading(false)
setNoDataFound(prices.length === 0)
} catch {
} catch (e) {
console.error(e)
setIsLoading(false)
setNoDataFound(true)
setAvgBuyPrice(0)
Expand Down
2 changes: 1 addition & 1 deletion utils/GraphUtils.tsx
Expand Up @@ -36,7 +36,7 @@ export function applyMayorDataToChart(chartOptions, mayorData: MayorData[], seri
data: mayorDataCopy.map((data, i) => {
return [
{
name: data.winner.name,
name: data.winner?.name || '',
valueDim: 'x',
x: `${10 + data.startPercentage * 0.8}%`,
y: 'min',
Expand Down

0 comments on commit 29983cf

Please sign in to comment.