Home > iPhone Dev > Fixing “Potential null dereference. According to coding standards in ‘Creating and Returning NSError Objects’ the parameter ‘error’ may be null” in SFHFKeychainUtils running the Static Analyzer

Fixing “Potential null dereference. According to coding standards in ‘Creating and Returning NSError Objects’ the parameter ‘error’ may be null” in SFHFKeychainUtils running the Static Analyzer

Real quick post- if you run static analyzer, Clang, etc and it’s giving you this issue, it’s an easy fix. The error references the documentation that you can look at: “Creating and Returning NSError Objects” -see section 3-5.

This is what the error will look like:
SFHFKeychainUtils Potential Null dereference
This is how you fix it:
Fixing the potential null dereference error
Pretty simple just put an if statement around it to make sure error isn’t null already!

Just saw this:
http://github.com/yllan/scifihifi-iphone/commit/9816a98f674b2933588e0447a9148ecd626882eb (unfortunately it’s not incorporated yet into the Master)

Share
Categories: iPhone Dev Tags:
  1. No comments yet.
  1. No trackbacks yet.