facebookincubator / SocketRocket

A conforming Objective-C WebSocket client library.
Other
9.56k stars 2.01k forks source link

setSR_SSLPinnedCertificates potentially calls setProperty with null #516

Open peternlewis opened 7 years ago

peternlewis commented 7 years ago

SR_SSLPinnedCertificates is explicitly marked as nullable, and NSURLProtocol setProperty is not. The documentation (header and docs) make no mention of what happens if the property is nil, though most Foundation classes will throw an exception in that case.

Probably the most sensible solution is simply to mark the parameter as not nullable, since it is unclear why you would ever want to set it to nil after setting it to something else (or why you would bother setting it to nil otherwise). But that does not work because the property itself is nullable. So that leaves this: