Skip to content

Commit e1d3b5f

Browse files
fix(getTarget): do not return null; throw (#623)
If it returns as it did does, it would be able to return null as it would immediately return and not go into the null check with throws.
1 parent e71c427 commit e1d3b5f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ export function getTarget(target) {
116116
}
117117

118118
if (typeof target === 'string' && document) {
119-
const selection = document.querySelector(target);
119+
let selection = document.querySelector(target);
120120
if (selection === null) {
121-
return document.querySelector(`#${target}`);
121+
selection = document.querySelector(`#${target}`);
122122
}
123123
if (selection === null) {
124124
throw new Error(`The target '${target}' could not be identified in the dom, tip: check spelling`);

0 commit comments

Comments
 (0)