提交 4371e72f 编写于 作者: M Matt Bierner

Fix potential null exception while dragging cells

上级 abf99de0
......@@ -467,10 +467,12 @@ export class MarkdownCellRenderer extends AbstractCellRenderer implements IListR
DOM.reset(dragImageContainer, templateData.container.cloneNode(true));
// Remove all rendered content nodes after the
const markdownContent = dragImageContainer.querySelector('.cell.markdown')!;
const contentNodes = markdownContent.children[0].children;
for (let i = contentNodes.length - 1; i >= 1; i--) {
contentNodes.item(i)!.remove();
const markdownContent = dragImageContainer.querySelector('.cell.markdown');
const contentNodes = markdownContent?.children[0].children;
if (contentNodes) {
for (let i = contentNodes.length - 1; i >= 1; i--) {
contentNodes.item(i)!.remove();
}
}
return dragImageContainer;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册