Skip to content

Commit

Permalink
fix: document should never be null (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Mar 18, 2024
1 parent 03d787b commit 1c4cdd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Iframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const MotionFlex = motion(Flex)

export interface IframeProps {
document: {
displayed: SanityDocument
draft: SanityDocument | null
published: SanityDocument | null
}
Expand All @@ -78,7 +79,7 @@ export interface IframeProps {

export function Iframe(props: IframeProps) {
const {document, options} = props
const draft = document.draft || document.published
const draft = document.draft || document.published || document.displayed

const {defaultSize = DEFAULT_SIZE, reload, attributes, showDisplayUrl = true, key} = options

Expand Down

0 comments on commit 1c4cdd3

Please sign in to comment.