Add exception description for invalid child index.
This commit is contained in:
@@ -24,7 +24,10 @@ namespace Cryville.Crtr.Event {
|
||||
= new Dictionary<Type, List<ContainerState>>();
|
||||
|
||||
public ContainerState GetChild(int index, Type handlerType) {
|
||||
return TypedChildren[handlerType][index];
|
||||
var list = TypedChildren[handlerType];
|
||||
if (index < 0 || index >= list.Count)
|
||||
throw new ArgumentOutOfRangeException("index", string.Format("{0}#{1} does not exist.", list[0].Handler.TypeName, index));
|
||||
return list[index];
|
||||
}
|
||||
|
||||
private bool m_active;
|
||||
|
Reference in New Issue
Block a user