diff --git a/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt b/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt index 96638065..be14291f 100644 --- a/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt +++ b/chartLib/src/main/kotlin/info/appdev/charting/components/Legend.kt @@ -27,7 +27,7 @@ class Legend() : ComponentBase() { NONE, /** - * Do not draw the a form, but leave space for it + * Do not draw the form, but leave space for it */ EMPTY, @@ -71,14 +71,14 @@ class Legend() : ComponentBase() { /** * The legend entries array */ - var entries: Array = arrayOf() + var entries: Array = arrayOf() private set /** * Entries that will be appended to the end of the auto calculated entries after calculating the legend. * (if the legend has already been calculated, you will need to call notifyDataSetChanged() to let the changes take effect) */ - var extraEntries: Array = arrayOf() + var extraEntries: Array = arrayOf() private set /** @@ -217,8 +217,8 @@ class Legend() : ComponentBase() { var max = 0f for (entry in this.entries) { - val label = entry.label - if (label == null) continue + if (entry == null) continue + val label = entry.label ?: continue val length = p.calcTextHeight(label).toFloat()