Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash fix #11873

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions FirebaseABTesting/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Unreleased
- [fixed] Fix crash caused by empty experiment payload.

# 10.14.0
- [fixed] Fix crash caused by mutating array during iteration. (#11669)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ - (void)setExperimentWithOrigin:(NSString *)origin
return;
}

if (payload.experimentId == nil) {
// When doing experiment test on devices, the payload could be empty. Returning here to prevent
// app crash.
FIRLogInfo(kFIRLoggerABTesting, @"I-ABT000020", @"Experiment Id in payload is empty.");
return;
}

if (maxNumOfExperiments <= experiments.count) {
ABTExperimentPayloadExperimentOverflowPolicy overflowPolicy =
[self overflowPolicyWithPayload:payload originalPolicy:policy];
Expand Down