mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Permit nil string in init
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@5504 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
61881ef6ce
commit
c390410a77
2 changed files with 7 additions and 6 deletions
|
@ -110,17 +110,18 @@ typedef struct {
|
|||
*/
|
||||
- (id) initWithString: (NSString *)aString
|
||||
{
|
||||
[super init];
|
||||
if ((self = [super init]) == nil)
|
||||
return nil;
|
||||
/*
|
||||
* Ensure that we have an NSGString so we can access its internals directly.
|
||||
*/
|
||||
if (aString == nil)
|
||||
{
|
||||
RELEASE(self);
|
||||
NSLog(@"Scanner initialised with nil string");
|
||||
return nil;
|
||||
aString = @"";
|
||||
}
|
||||
else if (fastClass(aString) == NSGString_class)
|
||||
|
||||
if (fastClass(aString) == NSGString_class)
|
||||
{
|
||||
_isUnicode = YES;
|
||||
_string = RETAIN(aString);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue