From d8d07bb112f4ea46f0d1bd86e3ce3f2735732b03 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Wed, 8 Jul 2026 18:08:23 +0200 Subject: [PATCH] Cosmetic in Legend --- .../kotlin/info/appdev/charting/components/Legend.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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()