Bug fix in SceneBase.RequestModuleInterface. Check that the list's count is greater than 0.

0.6.5-rc1
diva 2009-05-12 23:06:43 +00:00
parent 12a470e6a7
commit 7bf1d111e2
1 changed files with 2 additions and 1 deletions

View File

@ -435,8 +435,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>null if there is no registered module implementing that interface</returns>
public T RequestModuleInterface<T>()
{
if (ModuleInterfaces.ContainsKey(typeof(T)))
if (ModuleInterfaces.ContainsKey(typeof(T)) && (ModuleInterfaces[typeof(T)].Count > 0))
{
m_log.Debug("[XXX] RequestModuleInterface " + typeof(T).ToString() + " size: " + ModuleInterfaces[typeof(T)].Count);
return (T)ModuleInterfaces[typeof(T)][0];
}
else