From ae95ed3ec98403143d1645e855eb683dba15a76c Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Mon, 11 Feb 2002 02:00:35 +0000 Subject: [PATCH] Fixed method returning a text container for when there is no text container set ... typically happening during text system setup git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12480 72102866-910b-0410-8b05-ffd578937521 --- Source/GSSimpleLayoutManager.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/GSSimpleLayoutManager.m b/Source/GSSimpleLayoutManager.m index aa95775ac..67145e18a 100644 --- a/Source/GSSimpleLayoutManager.m +++ b/Source/GSSimpleLayoutManager.m @@ -431,7 +431,14 @@ static NSCharacterSet *invSelectionWordGranularitySet; if (effectiveRange) *effectiveRange = NSMakeRange(0, [_textStorage length]); - return [_textContainers objectAtIndex: 0]; + if ([_textContainers count] == 0) + { + return nil; + } + else + { + return [_textContainers objectAtIndex: 0]; + } } - (void) setTextContainer: (NSTextContainer*)aTextContainer