Skip to content

Commit f33d7a1

Browse files
Check for AppCheck's existance before subscribing (#8898)
1 parent 76e2cd7 commit f33d7a1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Firestore/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Unreleased
2+
- [fixed] Fixed a bug in the AppCheck integration that caused the SDK to respond
3+
to unrelated notifications (#8895).
4+
15
# v8.9.0
26
- [added] Added support for Firebase AppCheck.
37
- [fixed] Fix a crash if `[FIRTransaction getDocument]` was called after

Firestore/core/src/credentials/firebase_app_check_credentials_provider_apple.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@
3131
FirebaseAppCheckCredentialsProvider::FirebaseAppCheckCredentialsProvider(
3232
FIRApp* app, id<FIRAppCheckInterop> app_check) {
3333
contents_ = std::make_shared<Contents>(app, app_check);
34-
std::weak_ptr<Contents> weak_contents = contents_;
3534

35+
if (app_check == nil) {
36+
return;
37+
}
38+
39+
std::weak_ptr<Contents> weak_contents = contents_;
3640
app_check_listener_handle_ = [[NSNotificationCenter defaultCenter]
3741
addObserverForName:[app_check tokenDidChangeNotificationName]
3842
object:nil

0 commit comments

Comments
 (0)