Fixed a possible null key exception when no AuxEnums are loaded.

This commit is contained in:
the_fiddler 2008-01-03 00:52:55 +00:00
parent 424c0b17dd
commit 1ae880a266

View file

@ -177,7 +177,7 @@ namespace Bind.Structures
TranslateConstantWithReference(enums[c.Reference].ConstantCollection[c.Value] as Constant, enums, auxEnums); TranslateConstantWithReference(enums[c.Reference].ConstantCollection[c.Value] as Constant, enums, auxEnums);
value = (enums[c.Reference].ConstantCollection[c.Value] as Constant).Value; value = (enums[c.Reference].ConstantCollection[c.Value] as Constant).Value;
} }
else if (auxEnums[c.Reference].ConstantCollection.ContainsKey(c.Value)) else if (auxEnums.Count > 0 && auxEnums[c.Reference].ConstantCollection.ContainsKey(c.Value))
{ {
TranslateConstantWithReference(auxEnums[c.Reference].ConstantCollection[c.Value] as Constant, enums, auxEnums); TranslateConstantWithReference(auxEnums[c.Reference].ConstantCollection[c.Value] as Constant, enums, auxEnums);
value = (auxEnums[c.Reference].ConstantCollection[c.Value] as Constant).Value; value = (auxEnums[c.Reference].ConstantCollection[c.Value] as Constant).Value;