You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, attempting a Firestore document load (of any nature) with an empty ID causes a runtime exception which results in a crash. By "empty ID" I am referring to a string whose character count is zero, but where the object is non-nil. Literally, an empty string.
While Firestore handles a number of errors and returns the failure results gracefully in many cases, this is not one of those. It would be nice if the SDK could catch this and return an error
Steps to reproduce:
Start in a Swift environment
Create a Firestore document or collection request
In the document ID parameter: .document(ID), supply a non-nil but empty string such as "".
Firestore throws a fatal error and causes the application to crash.
Crash logs are difficult to parse, as the throw occurs deep inside the Firestore core framework.
Relevant Code
It appears, from crash logs that this occurs deep in the Firestore framework (core/src/api/collection_reference.cc):
Unfortunately, if(!documentPath) does not handle cases where strings may be non-nil, yet still empty (something I think may have been made possible in a recent Swift release 🥴?).
The text was updated successfully, but these errors were encountered:
Environment
Swift Package Manager
The Problem
Currently, attempting a Firestore document load (of any nature) with an empty ID causes a runtime exception which results in a crash. By "empty ID" I am referring to a string whose character count is zero, but where the object is non-nil. Literally, an empty string.
While Firestore handles a number of errors and returns the failure results gracefully in many cases, this is not one of those. It would be nice if the SDK could catch this and return an error
Steps to reproduce:
.document(ID)
, supply a non-nil but empty string such as""
.Relevant Code
It appears, from crash logs that this occurs deep in the Firestore framework (
core/src/api/collection_reference.cc
):return DocumentReference(std::move(path), firestore());
There seems to be an attempt to handle the issue and fail gracefully in
Source/API/FIRCollectionReference.mm
):Unfortunately,
if(!documentPath)
does not handle cases where strings may be non-nil, yet still empty (something I think may have been made possible in a recent Swift release 🥴?).The text was updated successfully, but these errors were encountered: