@@ -595,22 +595,24 @@ public void drawValues(Canvas c) {
595595
596596 Entry entry = dataSet .getEntryForIndex (j / 2 + mXBounds .min );
597597
598- if (dataSet .isDrawValuesEnabled ()) {
599- drawValue (c , dataSet .getValueFormatter (), entry .getY (), entry , i , x ,
600- y - valOffset , dataSet .getValueTextColor (j / 2 ));
601- }
602-
603- if (entry .getIcon () != null && dataSet .isDrawIconsEnabled ()) {
604-
605- Drawable icon = entry .getIcon ();
606-
607- Utils .drawImage (
608- c ,
609- icon ,
610- (int )(x + iconsOffset .x ),
611- (int )(y + iconsOffset .y ),
612- icon .getIntrinsicWidth (),
613- icon .getIntrinsicHeight ());
598+ if (entry != null ) {
599+ if (dataSet .isDrawValuesEnabled ()) {
600+ drawValue (c , dataSet .getValueFormatter (), entry .getY (), entry , i , x ,
601+ y - valOffset , dataSet .getValueTextColor (j / 2 ));
602+ }
603+
604+ if (entry .getIcon () != null && dataSet .isDrawIconsEnabled ()) {
605+
606+ Drawable icon = entry .getIcon ();
607+
608+ Utils .drawImage (
609+ c ,
610+ icon ,
611+ (int )(x + iconsOffset .x ),
612+ (int )(y + iconsOffset .y ),
613+ icon .getIntrinsicWidth (),
614+ icon .getIntrinsicHeight ());
615+ }
614616 }
615617 }
616618
0 commit comments