Skip to content

Commit

Permalink
fix: #224
Browse files Browse the repository at this point in the history
  • Loading branch information
taoqf committed Nov 14, 2022
1 parent 8256dcf commit fc367fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function hasAttrib(elem: HTMLElement, name: string) {
function findOne(test: Predicate, elems: Node[]) {
let elem = null as HTMLElement | null;

for (let i = 0, l = elems.length; i < l && !elem; i++) {
for (let i = 0, l = elems?.length; i < l && !elem; i++) {
const el = elems[i];
if (test(el)) {
elem = el;
Expand Down

0 comments on commit fc367fa

Please sign in to comment.