Check length of IEnumerable
This commit is contained in:
parent
c4183f1b95
commit
f6f7fd7d05
@ -80,7 +80,7 @@ namespace Aml.Editor.Plugin
|
|||||||
IEnumerable<PackagePart> rootParts = amlx.GetPartsByRelationShipType(AutomationMLContainer.RelationshipType.Root);
|
IEnumerable<PackagePart> rootParts = amlx.GetPartsByRelationShipType(AutomationMLContainer.RelationshipType.Root);
|
||||||
|
|
||||||
// We expect the aml to only have one root part
|
// 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();
|
PackagePart part = rootParts.First();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user