From 7ce3d3225d3fa1473b23f3960469aa00b1505b07 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Mon, 17 Oct 2022 16:58:02 -0700 Subject: [PATCH] layout: add guard --- src/services/Layout.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/Layout.ts b/src/services/Layout.ts index 4b429cac..47f2c577 100644 --- a/src/services/Layout.ts +++ b/src/services/Layout.ts @@ -23,6 +23,8 @@ export function getLayout( height: number, rowHeight?: number, }[] { + if (input.length === 0) return []; + if (!opts.squareMode) { return justifiedLayout((input), { containerPadding: 0,