Skip to content

Commit

Permalink
src: Do not crash if attribute list or command list is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
zakaria-fadli-netatmo committed May 7, 2024
1 parent dd6409d commit 9fc4a3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/AttributesTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const AttributeTable = ({ attributes }) => {
</TableRow>
</TableHead>
<TableBody>
{attributes.map((attribute, index) => (
{attributes && attributes.map((attribute, index) => (
<TableRow key={index}>
<TableCell>{capitalCase(attribute.name)}</TableCell>
<TableCell>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommandsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const CommandsTable = ({ commands, cluster_code, cluster_side }) => {
</TableRow>
</TableHead>
<TableBody>
{commands.map((command, index) => (
{commands && commands.map((command, index) => (
<CommandRow
key={index}
command={command}
Expand Down

0 comments on commit 9fc4a3d

Please sign in to comment.