Skip to content

Commit

Permalink
make sure signal.reason is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Sep 21, 2022
1 parent 5240487 commit 0dd86b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demos/demo-create-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
});
li.title += `\n Last modification date: ${entry.lastModDate.toLocaleString()}\n Compressed size: ${entry.compressedSize.toLocaleString()} bytes`;
} catch (error) {
if (signal.reason.code == error.code) {
if (signal.reason && signal.reason.code == error.code) {
if (!li.previousElementSibling && !li.nextElementSibling) {
fileList.classList.add("empty");
}
Expand Down
2 changes: 1 addition & 1 deletion demos/demo-read-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
const clickEvent = new MouseEvent("click");
a.dispatchEvent(clickEvent);
} catch (error) {
if (signal.reason.code != error.code) {
if (!signal.reason || signal.reason.code != error.code) {
throw error;
}
} finally {
Expand Down

0 comments on commit 0dd86b2

Please sign in to comment.