diff --git a/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.kt b/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.kt
index 7fbeb1716..b29190a55 100644
--- a/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.kt
+++ b/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.kt
@@ -208,8 +208,8 @@ class ErrorActivity : AppCompatActivity() {
private fun buildMarkdown(): String {
try {
return buildString(1024) {
- val userComment = binding.errorCommentBox.getText().toString()
- if (!userComment.isEmpty()) {
+ val userComment = binding.errorCommentBox.text.toString()
+ if (userComment.isNotEmpty()) {
appendLine(userComment)
}
@@ -229,28 +229,27 @@ class ErrorActivity : AppCompatActivity() {
// Collapse all logs to a single paragraph when there are more than one
// to keep the GitHub issue clean.
- if (errorInfo.stackTraces.size > 1) {
+ if (errorInfo.stackTraces.isNotEmpty()) {
append(" \n")
- }
- // add the logs
- for (i in errorInfo.stackTraces.indices) {
- append(" \n")
+ append("\n```\n${stacktrace}\n```\n")
+ append(" \n")
- append("\n```\n${errorInfo.stackTraces[i]}\n```\n")
- append("Exceptions (")
append(errorInfo.stackTraces.size)
append(")
Crash log ")
- if (errorInfo.stackTraces.size > 1) {
- append(i + 1)
+ // add the logs
+ errorInfo.stackTraces.forEachIndexed { index, stacktrace ->
+ append("
Crash log ")
+ if (errorInfo.stackTraces.isNotEmpty()) {
+ append(index + 1)
+ }
+ append("")
+ append("