@@ -208,8 +208,8 @@ class ErrorActivity : AppCompatActivity() {
208208 private fun buildMarkdown (): String {
209209 try {
210210 return buildString(1024 ) {
211- val userComment = binding.errorCommentBox.getText() .toString()
212- if (! userComment.isEmpty ()) {
211+ val userComment = binding.errorCommentBox.text .toString()
212+ if (userComment.isNotEmpty ()) {
213213 appendLine(userComment)
214214 }
215215
@@ -229,28 +229,27 @@ class ErrorActivity : AppCompatActivity() {
229229
230230 // Collapse all logs to a single paragraph when there are more than one
231231 // to keep the GitHub issue clean.
232- if (errorInfo.stackTraces.size > 1 ) {
232+ if (errorInfo.stackTraces.isNotEmpty() ) {
233233 append(" <details><summary><b>Exceptions (" )
234234 append(errorInfo.stackTraces.size)
235235 append(" )</b></summary><p>\n " )
236- }
237236
238- // add the logs
239- for (i in errorInfo.stackTraces.indices) {
240- append(" <details><summary><b>Crash log " )
241- if (errorInfo.stackTraces.size > 1 ) {
242- append(i + 1 )
237+ // add the logs
238+ errorInfo.stackTraces.forEachIndexed { index, stacktrace ->
239+ append(" <details><summary><b>Crash log " )
240+ if (errorInfo.stackTraces.isNotEmpty()) {
241+ append(index + 1 )
242+ }
243+ append(" </b>" )
244+ append(" </summary><p>\n " )
245+ append(" \n ```\n ${stacktrace} \n ```\n " )
246+ append(" </details>\n " )
243247 }
244- append(" </b>" )
245- append(" </summary><p>\n " )
246- append(" \n ```\n ${errorInfo.stackTraces[i]} \n ```\n " )
247- append(" </details>\n " )
248- }
249248
250- // make sure to close everything
251- if (errorInfo.stackTraces.size > 1 ) {
249+ // make sure to close everything
252250 append(" </p></details>\n " )
253251 }
252+
254253 append(" <hr>\n " )
255254 }
256255 } catch (exception: Exception ) {
0 commit comments