mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Correction for failed test in NSXMLDocument.m
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34676 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f754ea74cb
commit
3bfd09d528
2 changed files with 28 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2012-01-30 22:55-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSXMLDocument.m: Do type check to make sure that
|
||||
argument passed into initWithData:... is a subclass of
|
||||
NSData also check if it's nil. In either case throw an
|
||||
exception.
|
||||
|
||||
2012-01-05 22:20-EST Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/NSXMLPrivate.h
|
||||
|
|
|
@ -107,8 +107,27 @@ extern void clearPrivatePointers(xmlNodePtr aNode);
|
|||
options: (NSUInteger)mask
|
||||
error: (NSError**)error
|
||||
{
|
||||
NSString *string = [[NSString alloc] initWithData: data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
NSString *string = nil;
|
||||
|
||||
// Check for nil data and throw an exception
|
||||
if (![data isKindOfClass: [NSData class]])
|
||||
{
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[NSXMLDocument-%@] non data argument",
|
||||
NSStringFromSelector(_cmd)];
|
||||
}
|
||||
if (nil == data)
|
||||
{
|
||||
DESTROY(self);
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"[NSXMLDocument-%@] nil argument",
|
||||
NSStringFromSelector(_cmd)];
|
||||
}
|
||||
|
||||
// Initialize the string...
|
||||
string = [[NSString alloc] initWithData: data
|
||||
encoding: NSUTF8StringEncoding];
|
||||
AUTORELEASE(string);
|
||||
return [self initWithXMLString:string options:mask error:error];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue