3 ms·
This is exactly what happens. Basically a null value is converted into an NSNull object and calling count on it will of course throw an exception... because the
by AndrewZM 6y ago
This is exactly what happens. Basically a null value is converted into an NSNull object and calling count on it will of course throw an exception... because there is no count method in that class...
It makes me wonder what all those engineers at FB are actually doing... ? Every time I tried to integrate or look into the FB SDK for simple functionality it was a total clusterfuck.
- zentiggr 6y agoSounds like a good reason to stop trying. A bit of snark but also maybe stop trying to use a data collection engine to leverage anything for yourself?
- x86_64Ubuntu 6y agoThat's amateur hour stuff. Every developer in pretty much every language or platform learns VERY quickly what happens when you don't do a null check.
- blago 6y agoNSNull is not the null you think
- x86_64Ubuntu 6y agoIt may not be a conventional null, but I'm not aware of any tech where calling "count" on a Null, .nil? or otherwise null-like construct won't end horribly.
- plorkyeran 6y agoThe Facebook SDK is written in obj-c, where calling `count` on `nil` is perfectly valid and returns 0. It only doesn't work on NSNull, which is a weird different thing that does not work like the language's built-in null.