Skip to content

Commit

Permalink
Bugfix: handle potentially null data (bug only appears in prod build …
Browse files Browse the repository at this point in the history
…on netlify preview)
  • Loading branch information
Nate Lanza committed Oct 15, 2024
1 parent 6841b04 commit a98ef43
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const secondAggRR = (data: any, state: UpsetConfig) => {
* @returns The sorted rows based on the RR and the provided sorting options.
*/
const sortByRR = (data: any, state: UpsetConfig) => {
if (!Object.hasOwn(data, 'sets')) return { order: [], values: {} };

const vSets: Sets = Object.fromEntries(Object.entries(data.sets as Sets).filter(([name, _set]) => state.visibleSets.includes(name)));
const rr = secondAggRR(data, state);

Expand Down

0 comments on commit a98ef43

Please sign in to comment.