Skip to content

Commit

Permalink
fix: crash on virtual list when items array is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
AXeL-dev committed May 29, 2022
1 parent 6aab1d7 commit bf92683
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Allowed/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class Allowed extends Component {
</Table.HeaderCell>
</Table.Head>
<Table.VirtualBody
scrollToIndex={this.state.scrollToIndex}
scrollToIndex={items.length > 0 ? this.state.scrollToIndex : undefined}
height="calc(100% - 32px)"
>
{items.map((item) => this.renderRow({ row: item }))}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Logs/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export class Logs extends Component {
</Table.HeaderCell>
</Table.Head>
<Table.VirtualBody
scrollToIndex={this.state.scrollToIndex}
scrollToIndex={items.length > 0 ? this.state.scrollToIndex : undefined}
height="calc(100% - 32px)"
>
{items.map((item) => this.renderRow({ row: item }))}
Expand Down

0 comments on commit bf92683

Please sign in to comment.