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
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -57,7 +57,7 @@ internal data class Wikipedia(
val shareIntent = Intent(Intent.ACTION_SEND) val shareIntent = Intent(Intent.ACTION_SEND)
shareIntent.putExtra( shareIntent.putExtra(
Intent.EXTRA_TEXT, "${label}\n\n" + Intent.EXTRA_TEXT, "${label}\n\n" +
"${text.substring(0, 200)}\n\n" + "${text.substring(0, 200.coerceAtMost(text.length))}\n\n" +
sourceUrl sourceUrl
) )
shareIntent.type = "text/plain" shareIntent.type = "text/plain"