fix: add null check for top charts bg gradient (#193)

This commit is contained in:
Gabe Farrell 2026-02-03 11:23:30 -05:00 committed by GitHub
parent b06685c1af
commit 531c72899c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,7 +40,7 @@ export default function ChartLayout<T>({
useEffect(() => { useEffect(() => {
if ((data?.items?.length ?? 0) === 0) return; if ((data?.items?.length ?? 0) === 0) return;
const img = (data.items[0] as any)?.item.image; const img = (data.items[0] as any)?.item?.image;
if (!img) return; if (!img) return;
average(imageUrl(img, "small"), { amount: 1 }).then((color) => { average(imageUrl(img, "small"), { amount: 1 }).then((color) => {