Skip to content

Commit

Permalink
Protection against empty hlists
Browse files Browse the repository at this point in the history
Page with id: 8239846 has an empty or malformed hlist which throws a "TypeError: Invalid attempt to destructure non-iterable instance" exception.
  • Loading branch information
xcarol authored Oct 11, 2023
1 parent 120f331 commit 4db7fbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data-types/hlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default {
globalPattern: hlistGlobalPattern,
parsePattern: hlistPattern,
parse: (results) => {
if (!results) {
return [];
}
let [, elements] = results;
return elements.split('|');
},
Expand Down

0 comments on commit 4db7fbb

Please sign in to comment.