Skip to content

Commit

Permalink
add small validation
Browse files Browse the repository at this point in the history
  • Loading branch information
brauliorivas committed Aug 8, 2024
1 parent 109b985 commit 18119d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions js/views/templates/onewayview.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export function oneWayView(viewObjects, fromCollectionName, relationName) {
const fromCollection = relations.map((relation) => relation.from);
const toCollection = relations.map((relation) => relation.to);

if (fromCollection.length === 0 || toCollection.length === 0) {
return [0, 0];
}

const fromWidth = fromCollection[0].width;
const toWidth = toCollection[0].width;
const fromHorizontalGap = 0.3 * fromWidth;
Expand Down

0 comments on commit 18119d5

Please sign in to comment.