71squared/TBXML — pull request #6 by kristopherjohnson (2012-04-22 15:27:52+00:00)
Title: Prevent crashes when calling deprecated functions

Deprecated functions such as `+[TBXML tbxmlWithXMLData:]` were passing a null `error` pointer to other methods. This leads to a crash if an error occurs and the error-handling code doesn't check for a null pointer before setting the error.

These methods are deprecated, so callers shouldn't be using them, but legacy code should not crash.

This commit solves that problem by creating a local `NSError` reference and passing a pointer to that. For example:

- (id)initWithXMLData:(NSData*)aData {
NSError *error = nil;
return [self initWithXMLData:aData error:&error];
}

A test case has been added. This test case crashed before the fixes were made.