B2021-033: crash on copy/paste replace of figure
This commit is contained in:
		| @@ -543,12 +543,15 @@ namespace VEPROMS.CSLA.Library | |||||||
| 		private static int GetMaxSubStepLevel(ItemInfo parent) | 		private static int GetMaxSubStepLevel(ItemInfo parent) | ||||||
| 		{ | 		{ | ||||||
| 			int maxStepLevel = parent.StepLevel-1; // subtract one to account for HLS - we want the sub-step level | 			int maxStepLevel = parent.StepLevel-1; // subtract one to account for HLS - we want the sub-step level | ||||||
|  | 			if (parent.Steps != null)		// B2021-033: check for null | ||||||
|  | 			{ | ||||||
| 				foreach (ItemInfo kid in parent.Steps) | 				foreach (ItemInfo kid in parent.Steps) | ||||||
| 				{ | 				{ | ||||||
| 					if (kid.Steps != null) | 					if (kid.Steps != null) | ||||||
| 						maxStepLevel = Math.Max(maxStepLevel, GetMaxSubStepLevel(kid)); | 						maxStepLevel = Math.Max(maxStepLevel, GetMaxSubStepLevel(kid)); | ||||||
| 					else | 					else | ||||||
| 					maxStepLevel = Math.Max(maxStepLevel,kid.StepLevel-1); // subtract one to account for HLS because we are counting only sub-step levels | 						maxStepLevel = Math.Max(maxStepLevel, kid.StepLevel - 1); // subtract one to account for HLS because we are counting only sub-step levels | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
| 			return maxStepLevel; | 			return maxStepLevel; | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user