google / eDistantObject

eDistantObject (eDO) - Remote invocation library for iOS
Apache License 2.0
176 stars 36 forks source link

Don't prevent passing NULL to non-Objective-C pointer parameters. #226

Closed copybara-service[bot] closed 3 years ago

copybara-service[bot] commented 3 years ago

Don't prevent passing NULL to non-Objective-C pointer parameters.

The purpose for disallowing non-Objective-C pointer parameters is because there's no way to know how big a C pointer's underlying data is. But if the pointer is NULL, then there's nothing to pass, so just pass NULL and don't throw an exception. This opens up partial support for key-value observing and other APIs that take optional context pointers (so long as the caller doesn't provide one).