Closed
Description
We have a specific app crash on production:

From my investigation so far it seems that in some very rare cases (depending on the url value) the NSURL Foundation class cannot find the lastPathComponent
.
Looking into the documentation:
https://developer.apple.com/documentation/foundation/nsurl/lastpathcomponent?language=objc
it seems that the Objective-C implementation is using underneath a deprecated method:
https://developer.apple.com/documentation/foundation/nsstring/replacingpercentescapes(using:)?language=objc
This is (so far) the only reason I've found, that might cause either the NSURL
itself or the returned lastpathcomponent
to be nil
.