Skip to content

Commit

Permalink
protect against nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
kdoh committed Sep 19, 2017
1 parent 9c229a0 commit a840223
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/metabase/xray/components/Periodicity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const Periodicity = ({ xray }) =>
<div className="bg-white bordered rounded shadowed">
<div className="Grid Grid--gutters Grid--1of4">
{ PERIODICITY.map(period =>
xray[`histogram-${period}`] && (
xray[`histogram-${period}`] && xray[`histogram-${period}`].value && (
<div className="Grid-cell">
<div className="p4 border-right border-bottom">
<div style={{ height: 120}}>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/metabase/xray/components/StatGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const StatGroup = ({ heading, xray, stats, showDescriptions }) =>
<div className="bordered rounded shadowed bg-white">
<ol className="Grid Grid--1of4">
{ stats.map(stat =>
!!xray[stat] && (
!!xray[stat] && xray[stat].value && (
<li className="Grid-cell p1 px2 md-p2 md-px3 lg-p3 lg-px4 border-right border-bottom" key={stat}>
<SimpleStat
stat={xray[stat]}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/metabase/xray/containers/FieldXray.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ class FieldXRay extends Component {
<div className="bg-white bordered shadowed">
<div className="lg-p4">
<div style={{ height: 300 }}>
<Histogram histogram={xray.histogram.value} />
{ xray.histogram.value &&
<Histogram histogram={xray.histogram.value} />
}
</div>
</div>
</div>
Expand Down

0 comments on commit a840223

Please sign in to comment.