Merge pull request #15452 from JoVictorNunes/fix-crash-remove-background

fix: check virtual background index
This commit is contained in:
Ramón Souza 2022-07-27 16:40:46 -03:00 committed by GitHub
commit 40f61ecce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,8 +137,12 @@ const VirtualBgSelector = ({
return setCurrentVirtualBg({ type: EFFECT_TYPES.NONE_TYPE });
}
setCurrentVirtualBg({ type, name });
if (!index || index < 0) return;
if (!shouldEnableBackgroundUpload()) {
if (index >= 0) findDOMNode(inputElementsRef.current[index]).focus();
findDOMNode(inputElementsRef.current[index]).focus();
} else {
if (customParams) {
dispatch({
@ -163,7 +167,6 @@ const VirtualBgSelector = ({
}
findDOMNode(inputElementsRef.current[0]).focus();
}
return setCurrentVirtualBg({ type, name });
});
const renderDropdownSelector = () => {