From 70cdaf5550d02f6c0b60bf31f08956a0afdebdbe Mon Sep 17 00:00:00 2001 From: "Yevhen Babiichuk (DustDFG)" Date: Fri, 13 Feb 2026 13:33:27 +0200 Subject: [PATCH] Partially revert: ErrorActivity: Kotlin-fy buildMarkdown method Partially reverts c3dbed54e50430b585e9d7b88cf22c9f3a6cc54c Fix the bug where collapse container for several crashlogs is created when only one crash log present --- .../org/schabi/newpipe/error/ErrorActivity.kt | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) 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 a8555abae..5dd0755c5 100644 --- a/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.kt +++ b/app/src/main/java/org/schabi/newpipe/error/ErrorActivity.kt @@ -228,24 +228,26 @@ 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.isNotEmpty()) { + if (errorInfo.stackTraces.size > 1) { append("
Exceptions (") append(errorInfo.stackTraces.size) append(")

\n") + } - // add the logs - errorInfo.stackTraces.forEachIndexed { index, stacktrace -> - append("

Crash log ") - if (errorInfo.stackTraces.isNotEmpty()) { - append(index + 1) - } - append("") - append("

\n") - append("\n```\n${stacktrace}\n```\n") - append("

\n") + // add the logs + errorInfo.stackTraces.forEachIndexed { index, stacktrace -> + append("
Crash log ") + if (errorInfo.stackTraces.size > 1) { + append(index + 1) } + append("") + append("

\n") + append("\n```\n${stacktrace}\n```\n") + append("

\n") + } - // make sure to close everything + // make sure to close everything + if (errorInfo.stackTraces.size > 1) { append("

\n") }