Skip to content

Commit

Permalink
remove 'null' message from empty slots
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatthes committed Oct 13, 2023
1 parent 20a4833 commit 1fffa91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@leuffen/jodastyle",
"version": "3.0.4",
"version": "3.0.5",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.module.js",
Expand Down
7 changes: 6 additions & 1 deletion src/helper/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ export async function getTemplateFilledWithContent(templateSelector : string, co

let selected: any;
if (slot.getAttribute("data-limit") === "1") {
selected = Array.from([content.querySelector(select)]);
let curElements = content.querySelector(select);
if (curElements === null) {
selected = [];
} else {
selected = Array.from([content.querySelector(select)]);
}
} else {
selected = Array.from(content.querySelectorAll(select));
}
Expand Down

0 comments on commit 1fffa91

Please sign in to comment.