From 9415778b189fbe1035189173b6d7fa6bb7d0ab34 Mon Sep 17 00:00:00 2001 From: kmichel Date: Mon, 29 Apr 2024 16:33:11 -0700 Subject: [PATCH] fix type issue --- .../VideoPlayerContexts/VideoPopoverMenuContext.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx b/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx index b74a26caa628..29156c438d3d 100644 --- a/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx +++ b/src/components/VideoPlayerContexts/VideoPopoverMenuContext.tsx @@ -1,4 +1,3 @@ -import type {AVPlaybackSourceObject} from 'expo-av'; import React, {useCallback, useContext, useMemo, useRef, useState} from 'react'; import * as Expensicons from '@components/Icon/Expensicons'; import type {PopoverMenuItem} from '@components/PopoverMenu'; @@ -34,7 +33,11 @@ function VideoPopoverMenuContextProvider({children}: ChildrenProps) { if (videoPopoverMenuPlayerRef.current === null) { return; } - const sourceURI = addEncryptedAuthTokenToURL((videoPopoverMenuPlayerRef.current.props.source as AVPlaybackSourceObject).uri); + const {source} = videoPopoverMenuPlayerRef.current?.props ?? {}; + if (typeof source === 'number' || !source) { + return; + } + const sourceURI = addEncryptedAuthTokenToURL(source.uri); fileDownload(sourceURI); }, [videoPopoverMenuPlayerRef]);