mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 02:30:45 +00:00
Merge pull request #2078 from weaveworks/2072-sparkline-errors
Fix sparkline crashing on stopped nodes
This commit is contained in:
@@ -72,7 +72,7 @@ export default class Sparkline extends React.Component {
|
||||
|
||||
render() {
|
||||
// Do nothing if no data or data w/o date are passed in.
|
||||
if (this.props.data.length === 0 || this.props.data[0].date === undefined) {
|
||||
if (!this.props.data || this.props.data.length === 0 || this.props.data[0].date === undefined) {
|
||||
return <div />;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ export default class Sparkline extends React.Component {
|
||||
}
|
||||
|
||||
Sparkline.propTypes = {
|
||||
data: React.PropTypes.array.isRequired
|
||||
data: React.PropTypes.array
|
||||
};
|
||||
|
||||
Sparkline.defaultProps = {
|
||||
|
||||
Reference in New Issue
Block a user