Commit a67e007e authored by Matija Obreza's avatar Matija Obreza
Browse files

Fix: NPE in PieChartCard

parent 149ec381
......@@ -20,6 +20,10 @@ class PieChartCard extends React.Component<IPieChartCardProps> {
public render() {
const {title, maxTerms = 5, terms, total, missing = 0, propertyItemProps, t} = this.props;
if (!total || !terms) {
return null;
}
const topXTerms = terms.slice(0, maxTerms).map((term) => ({title: term.term, value: term.count}));
const other = total - missing - topXTerms.map((term) => term.value).reduce((cur, val) => cur + val);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment