Prevent a crash when passing NULL
The NSParameterAssert was removed, but the proper checks weren’t added.
Use explicit comparisons
Replace `nil` check with `NULL` for byref arguments
Merge pull request #303