Earlier quoted context omitted.
There is more complexity in this. Proximate Issues The app makers cannot easily prevent the crash since it is happening in Facebook provided code. Perhaps the only thing they could do is to code in kill switches. Another possibility would be to modify the Facebook code. That introduces maintainability issues. The crash happened because of a server side change that triggered roughly the Objective-C equivalent of a nul…
> The crash happened because of a server side change that triggered roughly the Objective-C equivalent of a null pointer exception. > Objective-C is an old unsafe language. This was a safe crash, not an unsafe one. Swift can and would crash the same way.
Looks like the server passed empty value in JSON which got converted to NSNull in Objective-C. It's a common mistake to assume null is returned instead of NSNull.
The Swift equivalent of the JSON library should return nil which you then need to explicitly check for non nilness before using unless you use the unsafe exclamation pint.