File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,10 @@ class DashboardDetailPage extends React.Component {
116116
117117 getIPAddresses ( rangeType ) {
118118 this . getMetric ( "ip" , rangeType ) . then ( ( res ) => {
119+ if ( ! res . data ) {
120+ return ;
121+ }
122+
119123 this . setState ( {
120124 ipAddresses : res . data . slice ( 0 , 10 ) ,
121125 uniqueIPCount : res . data . length ,
@@ -207,6 +211,10 @@ class DashboardDetailPage extends React.Component {
207211 }
208212
209213 renderPieChart ( title , data ) {
214+ if ( data === null ) {
215+ data = [ ] ;
216+ }
217+
210218 const d = data . map ( ( item ) => {
211219 return { value : item . count , name : item . data } ;
212220 } ) ;
@@ -234,6 +242,10 @@ class DashboardDetailPage extends React.Component {
234242 }
235243
236244 renderBarChart ( title , data ) {
245+ if ( data === null ) {
246+ data = [ ] ;
247+ }
248+
237249 return (
238250 < div className = "dashboard-card" >
239251 < BarChartCard title = { title } data = { data } className = "dashboard-card" />
You can’t perform that action at this time.
0 commit comments