Skip to content

Commit 834f136

Browse files
authored
Merge pull request TeamNewPipe#13247 from dustdfg/crashlog_fix
Partially revert: ErrorActivity: Kotlin-fy buildMarkdown method
2 parents 01e77e2 + 70cdaf5 commit 834f136

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

app/src/main/java/org/schabi/newpipe/error/ErrorActivity.kt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,24 +228,26 @@ class ErrorActivity : AppCompatActivity() {
228228

229229
// Collapse all logs to a single paragraph when there are more than one
230230
// to keep the GitHub issue clean.
231-
if (errorInfo.stackTraces.isNotEmpty()) {
231+
if (errorInfo.stackTraces.size > 1) {
232232
append("<details><summary><b>Exceptions (")
233233
append(errorInfo.stackTraces.size)
234234
append(")</b></summary><p>\n")
235+
}
235236

236-
// add the logs
237-
errorInfo.stackTraces.forEachIndexed { index, stacktrace ->
238-
append("<details><summary><b>Crash log ")
239-
if (errorInfo.stackTraces.isNotEmpty()) {
240-
append(index + 1)
241-
}
242-
append("</b>")
243-
append("</summary><p>\n")
244-
append("\n```\n${stacktrace}\n```\n")
245-
append("</details>\n")
237+
// add the logs
238+
errorInfo.stackTraces.forEachIndexed { index, stacktrace ->
239+
append("<details><summary><b>Crash log ")
240+
if (errorInfo.stackTraces.size > 1) {
241+
append(index + 1)
246242
}
243+
append("</b>")
244+
append("</summary><p>\n")
245+
append("\n```\n${stacktrace}\n```\n")
246+
append("</details>\n")
247+
}
247248

248-
// make sure to close everything
249+
// make sure to close everything
250+
if (errorInfo.stackTraces.size > 1) {
249251
append("</p></details>\n")
250252
}
251253

0 commit comments

Comments
 (0)