Apply strictNullChecks to src/components/views/context_menus/* (#10367)

This commit is contained in:
Michael Telatynski 2023-03-14 09:29:35 +00:00 committed by GitHub
parent 4c2b5df1f2
commit 7c2511a592
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 29 deletions

View file

@ -54,7 +54,7 @@ const DeviceContextMenuSection: React.FC<IDeviceContextMenuSectionProps> = ({ de
useEffect(() => {
const getDevices = async (): Promise<void> => {
return setDevices((await MediaDeviceHandler.getDevices())[deviceKind]);
return setDevices((await MediaDeviceHandler.getDevices())?.[deviceKind] ?? []);
};
getDevices();
}, [deviceKind]);