Skip to content

Commit 7d995f5

Browse files
jcurtisgitim
authored andcommitted
Prevent crash by checking for undefined rowLayouts[key] (#93)
1 parent 4198d23 commit 7d995f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SortableList.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ export default class SortableList extends Component {
224224
if (rowsLayouts) {
225225
if (horizontal) {
226226
location.x = nextX;
227-
nextX += rowsLayouts[key].width;
227+
nextX += rowsLayouts[key] ? rowsLayouts[key].width : 0;
228228
} else {
229229
location.y = nextY;
230-
nextY += rowsLayouts[key].height;
230+
nextY += rowsLayouts[key] ? rowsLayouts[key].height : 0;
231231
}
232232
}
233233

0 commit comments

Comments
 (0)