Skip to content

Commit

Permalink
Fix potentially unsafe cast
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed May 5, 2021
1 parent 13d81db commit 6367aae
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,10 @@ async function webviewPreloads(markdownRendererModule: any, markdownDeps: any) {
}

const previewRoot = previewContainerNode.shadowRoot;
const previewNode = previewRoot?.getElementById('preview') as HTMLElement;
const previewNode = previewRoot?.getElementById('preview');
if (!previewNode) {
return;
}

// TODO: handle namespace
if (typeof content === 'string') {
Expand Down

0 comments on commit 6367aae

Please sign in to comment.