mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix potential use after dealloc
This commit is contained in:
parent
6f94c90d98
commit
da1a69e4bd
1 changed files with 6 additions and 6 deletions
|
@ -206,19 +206,19 @@ static BOOL initialized = NO;
|
|||
ascending: (BOOL) ascending
|
||||
comparator: (NSComparator) cmptr
|
||||
{
|
||||
if ([self init])
|
||||
if ((self = [self init]) != nil)
|
||||
{
|
||||
if (key == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@", _(@"Passed nil key when initializing "
|
||||
@"an NSSortDescriptor.")];
|
||||
format: @"%@", _(@"Passed nil key when initializing"
|
||||
@" an NSSortDescriptor.")];
|
||||
}
|
||||
if (cmptr == NULL)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"%@", _(@"Passed NULL comparator when initializing "
|
||||
@"an NSSortDescriptor.")];
|
||||
format: @"%@", _(@"Passed NULL comparator when"
|
||||
@" initializing an NSSortDescriptor.")];
|
||||
}
|
||||
|
||||
ASSIGN(_key, key);
|
||||
|
@ -237,7 +237,7 @@ static BOOL initialized = NO;
|
|||
ascending: (BOOL) ascending
|
||||
selector: (SEL) selector
|
||||
{
|
||||
if ([self init])
|
||||
if ((self = [self init]) != nil)
|
||||
{
|
||||
if (key == nil)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue