Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Open to any ideas / changes to approach on this one
Backstory:
There's a crash with no repro steps that was originally reported on Sapp when
[encryptedData writeToFile:filename options:NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication error:&error];
is called. @mbwimmer investigated and found that the fileName being nil could cause an exception but it was unclear how that scenario could happen (more discussion here). That fix went into Sapp's fork but now MP is also seeing the same issue (still no repro steps).It looks like we do have a nullability conflict where SFSDKEventStoreManager's init method specifies a non-null storeDirectory but the method used to generate the directory that's eventually passed into that init method can return nil which would make the original
fileName
argument nil. Note: I still don't know what user scenario would cause that.Two parts to the guards here: