Check length of IEnumerable

This commit is contained in:
Administrator 2022-05-05 18:19:42 +02:00
parent c4183f1b95
commit f6f7fd7d05

View File

@ -80,7 +80,7 @@ namespace Aml.Editor.Plugin
IEnumerable<PackagePart> rootParts = amlx.GetPartsByRelationShipType(AutomationMLContainer.RelationshipType.Root);
// We expect the aml to only have one root part
if (rootParts.First() != null)
if (rootParts.Count() != 0 && rootParts.First() != null)
{
PackagePart part = rootParts.First();