Fix substring index OOB Exception

Fix #639
This commit is contained in:
MM20
2023-12-22 18:30:52 +01:00
parent c2421b33ab
commit b901b68383
@@ -57,7 +57,7 @@ internal data class Wikipedia(
val shareIntent = Intent(Intent.ACTION_SEND)
shareIntent.putExtra(
Intent.EXTRA_TEXT, "${label}\n\n" +
"${text.substring(0, 200)}\n\n" +
"${text.substring(0, 200.coerceAtMost(text.length))}\n\n" +
sourceUrl
)
shareIntent.type = "text/plain"