From b414bfbe1231cbbb361a5d11f39baa9bca511cc5 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 13 Dec 2013 16:07:47 +0000 Subject: [PATCH] Added check for null template --- PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index d9b8b3c6..3c5be05b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -205,7 +205,7 @@ namespace VEPROMS.CSLA.Library { get { - if (_TopTemplateTypes == null) + if (_TopTemplateTypes == null && Templates != null) { _TopTemplateTypes = new Dictionary(); // loop through all of templates to find those that are top level, i.e. @@ -231,6 +231,7 @@ namespace VEPROMS.CSLA.Library NewTemplateFormat = false; // count newlines - which gives number of template records. int NumTemplates = 0; + if (TPL == null) return null; int indx = TPL.IndexOf('\n'); while (indx > -1) {