mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-24 12:11:18 +00:00
startOneIterationWithIndex: list: inContext: checks range before accessing the array now.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@13324 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a7860d4741
commit
6b973bbdfc
1 changed files with 16 additions and 7 deletions
|
@ -472,18 +472,27 @@ static char rcsId[] = "$Id$";
|
||||||
{
|
{
|
||||||
component=[context component];
|
component=[context component];
|
||||||
NSDebugMLLog(@"gswdync",@"_item=%@",_item);
|
NSDebugMLLog(@"gswdync",@"_item=%@",_item);
|
||||||
if (_list && _item)
|
|
||||||
[_item setValue:[list objectAtIndex:currentIndex]
|
if (_list && _item) {
|
||||||
inComponent:component];
|
if ([list count]>currentIndex) {
|
||||||
|
[_item setValue:[list objectAtIndex:currentIndex]
|
||||||
|
inComponent:component];
|
||||||
|
} else {
|
||||||
|
//NSLog(@"startOneIterationWithIndex SKIPPING setValue:inComponent index=%d list.count=%d",currentIndex, [list count]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"currentIndex=%d",currentIndex);
|
NSDebugMLLog(@"gswdync",@"currentIndex=%d",currentIndex);
|
||||||
NSDebugMLLog(@"gswdync",@"_index=%@",_index);
|
NSDebugMLLog(@"gswdync",@"_index=%@",_index);
|
||||||
if (_index)
|
if (_index) {
|
||||||
[_index setValue:[NSNumber numberWithShort:currentIndex]
|
[_index setValue:[NSNumber numberWithShort:currentIndex]
|
||||||
inComponent:component];
|
inComponent:component];
|
||||||
if (currentIndex==0)
|
}
|
||||||
|
if (currentIndex==0) {
|
||||||
[context appendZeroElementIDComponent];
|
[context appendZeroElementIDComponent];
|
||||||
else
|
} else {
|
||||||
[context incrementLastElementIDComponent];
|
[context incrementLastElementIDComponent];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue