Skip to content

Commit

Permalink
[no-issue]: Fixed unexpected errors when performing 'insertNumberOfFa…
Browse files Browse the repository at this point in the history
…cilities' alias transform on an empty table (#4227)
  • Loading branch information
rohan-bes authored Oct 17, 2022
1 parent fc30fc5 commit d27f734
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ export const insertNumberOfFacilitiesColumn = {
);
}

if (table.length() === 0) {
return table; // Skip if the table is empty
}

const organisationUnitValues = table.getColumnValues('organisationUnit');
const numberOfFacilitiesColumnValues = organisationUnitValues.map(organisationUnit => {
if (typeof organisationUnit !== 'string') {
Expand Down

0 comments on commit d27f734

Please sign in to comment.