Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFKeyChain and passing NULL as error #42

Open
johankool opened this issue Aug 28, 2012 · 2 comments
Open

EFKeyChain and passing NULL as error #42

johankool opened this issue Aug 28, 2012 · 2 comments

Comments

@johankool
Copy link
Member

The methods in EFKeyChain accept an **error, but if you're not interested and pass in NULL, this can cause EXC_BAD_ACCESS crashes. The work around is to pass in a NSError pointer anyway.

@ijansch
Copy link
Member

ijansch commented Aug 28, 2012

isn't it customary to pass in nil, not null, if you're not interested in an error?

On Aug 28, 2012, at 12:35 PM, Johan Kool notifications@github.com wrote:

The methods in EFKeyChain accept an **error, but if you're not interested and pass in NULL, this can cause EXC_BAD_ACCESS crashes. The work around is to pass in a NSError pointer anyway.


Reply to this email directly or view it on GitHub.

Ivo Jansch
Egeniq
CEO / Co-founder
ivo@egeniq.com
www.egeniq.com
+31681450625

@johankool
Copy link
Member Author

No: "Always test to see if the parameter is non-NULL before assigning an object to it. And never assign nil to an error parameter."

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ErrorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html#//apple_ref/doc/uid/TP40001806-CH204-SW5

On 29 Aug, 2012, at 00:00, Ivo Jansch notifications@github.com wrote:

isn't it customary to pass in nil, not null, if you're not interested in an error?

On Aug 28, 2012, at 12:35 PM, Johan Kool notifications@github.com wrote:

The methods in EFKeyChain accept an **error, but if you're not interested and pass in NULL, this can cause EXC_BAD_ACCESS crashes. The work around is to pass in a NSError pointer anyway.


Reply to this email directly or view it on GitHub.

Ivo Jansch
Egeniq
CEO / Co-founder
ivo@egeniq.com
www.egeniq.com
+31681450625

Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants