From 8093ae97cad3f0d57fc6dd687392bfafd49a9e56 Mon Sep 17 00:00:00 2001 From: jcurtis Date: Wed, 28 Feb 2018 10:12:00 -0400 Subject: [PATCH] Prevent crash by checking for undefined rowLayouts[key] --- src/SortableList.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SortableList.js b/src/SortableList.js index 69e93a0..9473e16 100644 --- a/src/SortableList.js +++ b/src/SortableList.js @@ -224,10 +224,10 @@ export default class SortableList extends Component { if (rowsLayouts) { if (horizontal) { location.x = nextX; - nextX += rowsLayouts[key].width; + nextX += rowsLayouts[key] ? rowsLayouts[key].width : 0; } else { location.y = nextY; - nextY += rowsLayouts[key].height; + nextY += rowsLayouts[key] ? rowsLayouts[key].height : 0; } }