Skip to content

Commit 4d6e4fc

Browse files
committed
refactor: remove non-null assertion
1 parent 2e80990 commit 4d6e4fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/selection/message.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ function findFrameBySource(source: MessageEventSource | null) {
4444
}
4545

4646
const roots: Array<Document | ShadowRoot> = [document]
47+
let root: Document | ShadowRoot | undefined
4748

48-
while (roots.length) {
49-
const root = roots.pop()!
49+
while ((root = roots.pop())) {
5050
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT)
5151
let element = walker.nextNode() as Element | null
5252

0 commit comments

Comments
 (0)