File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
MPChartLib/src/main/java/com/github/mikephil/charting Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -809,12 +809,13 @@ public String getAccessibilityDescription() {
809809
810810 PieData pieData = getData ();
811811
812- int entryCount = pieData .getEntryCount ();
812+ int entryCount = 0 ;
813+ if (pieData != null )
814+ entryCount = pieData .getEntryCount ();
813815
814816 StringBuilder builder = new StringBuilder ();
815817
816- builder .append (String .format (Locale .getDefault (), "The pie chart has %d entries." ,
817- entryCount ));
818+ builder .append (String .format (Locale .getDefault (), "The pie chart has %d entries." , entryCount ));
818819
819820 for (int i = 0 ; i < entryCount ; i ++) {
820821 PieEntry entry = pieData .getDataSet ().getEntryForIndex (i );
Original file line number Diff line number Diff line change 66import com .github .mikephil .charting .formatter .IValueFormatter ;
77import com .github .mikephil .charting .utils .MPPointF ;
88
9+ import androidx .annotation .Nullable ;
10+
911/**
1012 * Interface that provides everything there is to know about the dimensions,
1113 * bounds, and range of the chart.
@@ -53,6 +55,7 @@ public interface ChartInterface {
5355
5456 IValueFormatter getDefaultValueFormatter ();
5557
58+ @ Nullable
5659 ChartData getData ();
5760
5861 int getMaxVisibleCount ();
You can’t perform that action at this time.
0 commit comments