fix(trace): do not access null content window (#21166)
This commit is contained in:
parent
b735e136fe
commit
7626267ec5
|
|
@ -208,10 +208,8 @@ export const InspectModeController: React.FunctionComponent<{
|
||||||
setHighlightedLocator: (locator: string) => void,
|
setHighlightedLocator: (locator: string) => void,
|
||||||
}> = ({ iframe, isInspecting, sdkLanguage, testIdAttributeName, highlightedLocator, setHighlightedLocator }) => {
|
}> = ({ iframe, isInspecting, sdkLanguage, testIdAttributeName, highlightedLocator, setHighlightedLocator }) => {
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!iframe)
|
const win = iframe?.contentWindow as any;
|
||||||
return;
|
if (!win || !isInspecting && !highlightedLocator && !win._recorder)
|
||||||
const win = iframe.contentWindow as any;
|
|
||||||
if (!isInspecting && !highlightedLocator && !win._recorder)
|
|
||||||
return;
|
return;
|
||||||
let recorder: Recorder | undefined = win._recorder;
|
let recorder: Recorder | undefined = win._recorder;
|
||||||
if (!recorder) {
|
if (!recorder) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue