parse-community / Parse-Swift

The Swift SDK for Parse Platform (iOS, macOS, watchOS, tvOS, Linux, Android, Windows)
https://parseplatform.org
MIT License
308 stars 69 forks source link

Crash in `API.getHeaders(options:) ` #451

Open pktealshift opened 5 months ago

pktealshift commented 5 months ago

New Issue Checklist

Issue Description

A crash seems to occur when calling a particular cloud function but I don't know what's special about it.

Steps to reproduce

I'm not sure how to reproduce, but I'm getting frequent crash reports from users, and the crashing thread follows an attempt to call a cloud function that returns a ParseObject.

Actual Outcome

Crash.

Expected Outcome

No crash.

Environment

WatchOS 10.5

Client

Server

Database

Logs

OS Version:          Watch OS 10.5 (21T576)
Release Type:        User
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x0000000004363c38
Termination Reason: SIGNAL 5 Trace/BPT trap: 5
Terminating Process: exc handler [2744]

Triggered by Thread:  3

Thread 3 Crashed:
0   WATCH_Lionheart                 0x0000000004363c38 Swift runtime failure: Unexpectedly found nil while implicitly unwrapping an Optional value + 0 (API.swift:0)
1   WATCH_Lionheart                 0x0000000004363c38 specialized static API.getHeaders(options:) + 1856 (API.swift:0)
2   WATCH_Lionheart                 0x00000000043520d0 static API.getHeaders(options:) + 8 (<compiler-generated>:0)
3   WATCH_Lionheart                 0x00000000043520d0 API.Command.prepareURLRequest(options:batching:childObjects:childFiles:) + 980
4   WATCH_Lionheart                 0x0000000004350afc API.Command.executeAsync(options:batching:callbackQueue:notificationQueue:childObjects:childFiles:uploadProgress:downloadProgress:completion:) + 928 (API+Command.swift:139)
5   WATCH_Lionheart                 0x000000000447ec3c ParseCloudable.runFunction(options:callbackQueue:completion:) + 280 (ParseCloudable.swift:60)
6   WATCH_Lionheart                 0x000000000447e554 closure #1 in ParseCloudable.runFunction(options:) + 120
7   WATCH_Lionheart                 0x000000000447e2f4 partial apply for closure #1 in ParseCloudable.runFunction(options:) + 36 (<compiler-generated>:0)
8   libswift_Concurrency.dylib      0x00000000298cc75c closure #1 in withCheckedThrowingContinuation<A>(function:_:) + 96 (CheckedContinuation.swift:332)
9   libswift_Concurrency.dylib      0x00000000298cc7bc withUnsafeThrowingContinuation<A>(_:) + 68 (PartialAsyncTask.swift:651)
10  libswift_Concurrency.dylib      0x00000000298cc6b9 withCheckedThrowingContinuation<A>(function:_:) + 1 (CheckedContinuation.swift:331)
11  WATCH_Lionheart                 0x000000000447e295 ParseCloudable.runFunction(options:) + 1 (ParseCloudable+async.swift:23)
parse-github-assistant[bot] commented 5 months ago

Thanks for opening this issue!