when samples are missing sparkline shouldn't crash all js

This commit is contained in:
Paul Bellamy
2016-03-21 11:25:42 +00:00
parent cde2e1a826
commit 43547fae32

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 />;
}