Skip to content

Scope blocks with 0 actions cause exception #43

@gooseleggs

Description

@gooseleggs

Describe the bug
When a block (in this case a SCOPE block) has an actions key defined, but no values, the recursive call for Get-Actions fails and throws an error.

Add error message
Add the error message output from the PowerShell command:

Get-Action : The property 'Name' cannot be found on this object. Verify that the property exists.
At C:\temp\gooseleggs-logicappdocs\logicappdocs\src\Helper.ps1:105 char:17
+ ...             Get-Action -Actions $($action.Actions) -Parent $actionNam ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-Action], RuntimeException
    + FullyQualifiedErrorId : PropertyNotFoundStrict,Get-Action

To Reproduce
Steps to reproduce the behavior:

If possible upload the Logic App Flow or Power Automate Flow code.

Section of code that causes the issue:

"catch": {
                "type": "Scope",
                "actions": {},
                "runAfter": {
                    "PersonAccount": [
                        "SUCCEEDED"
                    ]
                }
            }

Expected behavior
Should continue to work without throwing an exception

Screenshots
If applicable, add screenshots to help explain your problem.
image

PowerShell version:
Run $PSVersionTable command in PowerShell host
e.g.

Name                           Value
----                           -----
PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

LogicAppDocs version

  • latest

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions