(Fix) Prevent accessing `contentWindow` if `iframe` is `null` (#1161)
This commit is contained in:
parent
cfefe69a59
commit
787e6ff711
|
@ -226,9 +226,9 @@ function Apps({ closeModal, closeSnackbar, enqueueSnackbar, openModal }) {
|
|||
const sendMessageToIframe = useCallback(
|
||||
(messageId, data) => {
|
||||
const app = getSelectedApp()
|
||||
iframeEl.contentWindow.postMessage({ messageId, data }, app.url)
|
||||
iframeEl?.contentWindow.postMessage({ messageId, data }, app.url)
|
||||
},
|
||||
[getSelectedApp, iframeEl.contentWindow],
|
||||
[getSelectedApp, iframeEl],
|
||||
)
|
||||
|
||||
// handle messages from iframe
|
||||
|
|
Loading…
Reference in New Issue