Skip to content

Commit fc4ce30

Browse files
committed
Reformat code and error by wrong selector
1 parent 16d6c35 commit fc4ce30

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

dist/js/avalynx-ref.esm.js

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export class AvalynxRef {
2424
selector = '.' + selector;
2525
}
2626
this.elements = document.querySelectorAll(selector);
27+
if (this.elements.length === 0) {
28+
console.error("AvalynxRef: Ref(s) with selector '" + selector + "' not found");
29+
return;
30+
}
2731
this.options = {
2832
isHtml: false,
2933
...options

dist/js/avalynx-ref.js

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class AvalynxRef {
2323
selector = '.' + selector;
2424
}
2525
this.elements = document.querySelectorAll(selector);
26+
if (this.elements.length === 0) {
27+
console.error("AvalynxRef: Ref(s) with selector '" + selector + "' not found");
28+
return;
29+
}
2630
this.options = {
2731
isHtml: false,
2832
...options

src/js/avalynx-ref.esm.js

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export class AvalynxRef {
2424
selector = '.' + selector;
2525
}
2626
this.elements = document.querySelectorAll(selector);
27+
if (this.elements.length === 0) {
28+
console.error("AvalynxRef: Ref(s) with selector '" + selector + "' not found");
29+
return;
30+
}
2731
this.options = {
2832
isHtml: false,
2933
...options

src/js/avalynx-ref.js

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class AvalynxRef {
2323
selector = '.' + selector;
2424
}
2525
this.elements = document.querySelectorAll(selector);
26+
if (this.elements.length === 0) {
27+
console.error("AvalynxRef: Ref(s) with selector '" + selector + "' not found");
28+
return;
29+
}
2630
this.options = {
2731
isHtml: false,
2832
...options

0 commit comments

Comments
 (0)