fix: assert error when toolWrapper is null (#1048)

This commit is contained in:
JimmFly 2023-02-16 13:38:33 +08:00 committed by GitHub
parent e2b17bc310
commit 520076b31d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,9 @@ const BlockHubAppender = () => {
abortController.signal.addEventListener('abort', () => { abortController.signal.addEventListener('abort', () => {
blockHubElement?.remove(); blockHubElement?.remove();
const toolWrapper = document.querySelector('#toolWrapper'); const toolWrapper = document.querySelector('#toolWrapper');
assertEquals(toolWrapper?.childNodes.length, 0); if (toolWrapper) {
assertEquals(toolWrapper.childNodes.length, 0);
}
}); });
editor?.createBlockHub().then(blockHub => { editor?.createBlockHub().then(blockHub => {