Added check for null template
This commit is contained in:
		@@ -205,7 +205,7 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
		{
 | 
							{
 | 
				
			||||||
			get
 | 
								get
 | 
				
			||||||
			{
 | 
								{
 | 
				
			||||||
				if (_TopTemplateTypes == null)
 | 
									if (_TopTemplateTypes == null && Templates != null)
 | 
				
			||||||
				{
 | 
									{
 | 
				
			||||||
					_TopTemplateTypes = new Dictionary<int, int>();
 | 
										_TopTemplateTypes = new Dictionary<int, int>();
 | 
				
			||||||
					// loop through all of templates to find those that are top level, i.e.
 | 
										// loop through all of templates to find those that are top level, i.e.
 | 
				
			||||||
@@ -231,6 +231,7 @@ namespace VEPROMS.CSLA.Library
 | 
				
			|||||||
					NewTemplateFormat = false;
 | 
										NewTemplateFormat = false;
 | 
				
			||||||
					// count newlines - which gives number of template records.
 | 
										// count newlines - which gives number of template records.
 | 
				
			||||||
					int NumTemplates = 0;
 | 
										int NumTemplates = 0;
 | 
				
			||||||
 | 
										if (TPL == null) return null;
 | 
				
			||||||
					int indx = TPL.IndexOf('\n');
 | 
										int indx = TPL.IndexOf('\n');
 | 
				
			||||||
					while (indx > -1)
 | 
										while (indx > -1)
 | 
				
			||||||
					{
 | 
										{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user