Fixes issues with NULL error pointers

Fixes Analyzer Warning:
"Potential null dereference.  According to coding standards in 'Creating and Returning NSError Objects' the parameter may be null"