Fix potential null dereference of NSError. (See Apple documentation on "Creating and returing NSError".)