o raise exception if empty keyPath in +setValue:inObject:forKeyPath:

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@19041 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Manuel Guesdon 2004-04-06 11:11:43 +00:00
parent 94eccc5e54
commit 864cbfbab0

View file

@ -195,7 +195,6 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
-(void)setValue:(id)value -(void)setValue:(id)value
inComponent:(GSWComponent*)component inComponent:(GSWComponent*)component
{ {
//OK
[self setValue:value [self setValue:value
inObject:component]; inObject:component];
}; };
@ -875,8 +874,13 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
NSStringFromClass([object class]), NSStringFromClass([object class]),
NSStringFromClass([object superclass])); NSStringFromClass([object superclass]));
NSDebugMLLog(@"associations",@"GSWAssociation: keyPath:%@",keyPath); NSDebugMLLog(@"associations",@"GSWAssociation: keyPath:%@",keyPath);
if (keyPath) if ([keyPath length]==0)
{ {
[NSException raise:NSInvalidArgumentException
format:@"No key path when setting value %@ in object of class %@",
value,NSStringFromClass(object)];
};
#if HAVE_GDL2 #if HAVE_GDL2
[object smartTakeValue:value [object smartTakeValue:value
forKeyPath:keyPath]; forKeyPath:keyPath];
@ -982,11 +986,6 @@ static NSMutableArray* associationsLogsHandlerClasses=nil;
}; };
}; };
#endif #endif
}
else
{
NSDebugMLLog(@"associations",@"GSWAssociation: setValue:%@ : NoKeyPath",value);
};
LOGClassFnStop(); LOGClassFnStop();
}; };