Skip to content

Commit

Permalink
Merge pull request #11 from ArthurClemens/handle-no-dataset
Browse files Browse the repository at this point in the history
Handle empty dataset
  • Loading branch information
ArthurClemens authored Jan 1, 2023
2 parents 424883a + 96521a0 commit 815d3a3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/dialogic-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ var clearDataset = (cache, id) => {
delete cache[id];
};
var applyDataset = (dataset, el) => {
if (!el)
if (!el || !dataset)
return;
Object.keys(dataset).forEach((key) => {
el.dataset[key] = dataset[key];
Expand Down
2 changes: 1 addition & 1 deletion dist/dialogic-js.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dialogic-js",
"version": "0.4.2",
"version": "0.4.3",
"description": "Control the opening and closing of dialogs and menus using HTML and (optionally) vanilla JavaScript.",
"types": "dist",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const applyDataset = (
dataset: DOMStringMap,
el?: HTMLElement | null
) => {
if (!el) return;
if (!el || !dataset) return;
Object.keys(dataset).forEach((key) => {
el.dataset[key] = dataset[key];
});
Expand Down

0 comments on commit 815d3a3

Please sign in to comment.