[Mono-list] Possible bug in FontInfo.cs (Possible fix included)

Rich Alimi rich@velvetsea.net
Fri, 19 Sep 2003 13:46:27 -0400


I was trying out a webcontrol (skmMenu from www.gotdotnet.com) and
received an IndexOutOfRangeException in FontInfo's get_Name method.

The current code is:

if(Names!=null)
	return Names[0];
return String.Empty;

It seems to me that this should be:

if(Names!=null && Names.Length>0)
	return Names[0];
return String.Empty;

>From the get_Names method it seems that the current code would fail when
the ViewState's FontInfoNames element contains an empty (non-null)
array.

I do not know too much about the internals of .NET, so I am posting this
here for comments.

Thanks,
Rich Alimi