Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 2b72f2b

Browse files
committed
Merge pull request #343 from jonathanp/fix-empty-object-error-msg
Differentiate between empty arrays and an empty objects in `DataView`
2 parents 913f8e5 + 103b872 commit 2b72f2b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

frontend/DataView/DataView.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ class DataView extends React.Component {
4141
}
4242
var path = this.props.path;
4343
if (!names.length) {
44-
return <span style={styles.empty}>Empty object</span>;
44+
return (
45+
<span style={styles.empty}>
46+
{Array.isArray(data) ? 'Empty array' : 'Empty object'}
47+
</span>
48+
);
4549
}
4650

4751
return (

0 commit comments

Comments
 (0)