Skip to content

Commit

Permalink
Test that the asset has a value
Browse files Browse the repository at this point in the history
  • Loading branch information
weotch committed Aug 22, 2023
1 parent 4a44613 commit 23f1f7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sanity-next/src/lib/sourceMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function aspectRatioFromSource(
): number | undefined {
if (!source) return undefined
if (typeof source != 'object' || !('asset' in source)) return undefined
return source.asset.metadata?.dimensions?.aspectRatio
return source.asset?.metadata?.dimensions?.aspectRatio
}

// Make object-position values from the hotspot data
Expand Down

0 comments on commit 23f1f7d

Please sign in to comment.