Skip to content

Commit

Permalink
Merge pull request #150 from sanity-io/fix/desk-tool-crash
Browse files Browse the repository at this point in the history
fix: Fixes #139 - desk tool crash
  • Loading branch information
LiamMartens authored Aug 4, 2023
2 parents 98b8443 + 82d23c9 commit a9e9d1a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/actions/DeleteMetadataAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export const DeleteMetadataAction: DocumentActionComponent = (props) => {
const [isDialogOpen, setDialogOpen] = useState(false)
const onClose = useCallback(() => setDialogOpen(false), [])
const translations: TranslationReference[] = useMemo(
() => (doc ? (doc[TRANSLATIONS_ARRAY_NAME] as TranslationReference[]) : []),
() =>
doc && Array.isArray(doc[TRANSLATIONS_ARRAY_NAME])
? (doc[TRANSLATIONS_ARRAY_NAME] as TranslationReference[])
: [],
[doc]
)

Expand Down

0 comments on commit a9e9d1a

Please sign in to comment.