Check that the return value is nil before attempting to do anything with the NSError object

Apple's Error Handling Programming Guide
(https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/
ErrorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html)
states that return values must be checked for nil or NO before
attempting to do anything with the NSError object