Skip to content

Commit

Permalink
hotfix: fix index out-of-bounds in startAttachingCrashLogMessages (#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
mallexxx authored Jul 23, 2024
1 parent eea55b8 commit ec7bfbc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Crashes/CrashCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ public final class CrashCollection {
objCexceptionReason["stackTrace"] = stackTrace
diagnosticMetaDataDict["objectiveCexceptionReason"] = objCexceptionReason
crashDiagnosticsDict["diagnosticMetaData"] = diagnosticMetaDataDict
crashDiagnostics[0] = crashDiagnosticsDict
if crashDiagnostics.isEmpty {
crashDiagnostics = [crashDiagnosticsDict]
} else {
crashDiagnostics[0] = crashDiagnosticsDict
}
dict["crashDiagnostics"] = crashDiagnostics

guard JSONSerialization.isValidJSONObject(dict) else {
Expand Down

0 comments on commit ec7bfbc

Please sign in to comment.