B2021-033: crash on copy/paste replace of figure
This commit is contained in:
		| @@ -543,6 +543,8 @@ 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) | ||||||
| @@ -550,6 +552,7 @@ namespace VEPROMS.CSLA.Library | |||||||
| 					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; | ||||||
| 		} | 		} | ||||||
| 		// F2021-009 Find the number of sub-step levels that the Copied Step has. | 		// F2021-009 Find the number of sub-step levels that the Copied Step has. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user