stefanstranger / logicappdocs

Generate technical Markdown documentation for your Azure Logic App and Power Automate Flows
MIT License
55 stars 4 forks source link

Scope blocks with 0 actions cause exception #43

Open gooseleggs opened 1 week ago

gooseleggs commented 1 week ago

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

Additional context Add any other context about the problem here.