when samples are missing sparkline shouldn't crash all js

This commit is contained in:
Paul Bellamy
2016-03-29 14:00:11 +01:00
parent cde2e1a826
commit 43547fae32
+1 -1
View File
@@ -20,7 +20,7 @@ export default class Sparkline extends React.Component {
let data = this.props.data;
// Do nothing if no data or data w/o date are passed in.
if (data.length === 0 || data[0].date === undefined) {
if (data === undefined || data.length === 0 || data[0].date === undefined) {
return <div />;
}