QuasarOriginal post
Rank 2: Process
Looks like when targets is empty it's coming back as a boolean. and the force unwrapping is causing a crash.
{
"$id": "66741ca31b0639e7522d",
"$createdAt": "2024-06-20T12:12:19.995+00:00",
"$updatedAt": "2024-06-20T12:12:19.995+00:00",
"name": "redacted",
"registration": "2024-06-20T12:12:19.982+00:00",
"status": true,
"labels": [],
"passwordUpdate": "2024-06-20T12:12:19.982+00:00",
"email": "redacted",
"phone": "",
"emailVerification": false,
"phoneVerification": false,
"mfa": false,
"prefs": {},
"targets": [
false
],
"accessedAt": "2024-06-20T12:12:19.982+00:00"
}
Summary
The 'targets' property is sometimes returning as a boolean instead of a dictionary, causing a crash due to force unwrapping. This occurs when 'targets' is empty. To prevent the crash, handle the case where 'targets' is a boolean.