Skip to content

Commit 96521a0

Browse files
committed
Dataset may be empty
1 parent 424883a commit 96521a0

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

dist/dialogic-js.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ var clearDataset = (cache, id) => {
118118
delete cache[id];
119119
};
120120
var applyDataset = (dataset, el) => {
121-
if (!el)
121+
if (!el || !dataset)
122122
return;
123123
Object.keys(dataset).forEach((key) => {
124124
el.dataset[key] = dataset[key];

dist/dialogic-js.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dialogic-js",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "Control the opening and closing of dialogs and menus using HTML and (optionally) vanilla JavaScript.",
55
"types": "dist",
66
"files": [

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export const applyDataset = (
129129
dataset: DOMStringMap,
130130
el?: HTMLElement | null
131131
) => {
132-
if (!el) return;
132+
if (!el || !dataset) return;
133133
Object.keys(dataset).forEach((key) => {
134134
el.dataset[key] = dataset[key];
135135
});

0 commit comments

Comments
 (0)