Fixed null reference

This commit is contained in:
John Jenko 2013-12-20 20:52:29 +00:00
parent 27703fe2c7
commit 2618a37dba

View File

@ -3247,6 +3247,7 @@ namespace VEPROMS.CSLA.Library
}
public int GetSmartTemplateTopLevelIndxOfThisType(int oftype)
{
if (FormatStepData == null) return -1;
FormatData formatData = FormatStepData.MyFormat.PlantFormat.FormatData;
if (formatData.TopTemplateTypes == null || formatData.TopTemplateTypes.Count == 0) return -1;
if (formatData.TopTemplateTypes.ContainsKey(oftype - 20001)) return formatData.TopTemplateTypes[oftype - 20001];