Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Length error on some logic app definitions #46

Open
gooseleggs opened this issue Dec 7, 2024 · 0 comments
Open

Length error on some logic app definitions #46

gooseleggs opened this issue Dec 7, 2024 · 0 comments

Comments

@gooseleggs
Copy link

Describe the bug
If the actionName has a length < 5, for example a Tri scope, then you will receive the following error message:

Where-Object : Exception calling "Substring" with "2" argument(s): "Length cannot be less than zero.
Parameter name: length"
At C:\temp\gooseleggs-logicappdocs\logicappdocs\src\Helper.ps1:276 char:76
+ ... ($Actions | Where-Object { $_.RunAfter -eq $(('{0}-False') -f $(($cur ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Where-Object], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentOutOfRangeException,Microsoft.PowerShell.Commands.WhereObjectCommand

This is caused by the line

                # Current error is that there can be an newly created action that does not have a parent property.???
                elseif (($null -ne $currentAction.Parent) -and ($Actions | Where-Object { $_.RunAfter -eq $(('{0}-False') -f $(($currentAction.Parent).Substring(0, ($currentAction.Parent).length - 5))) } )) {

in `helper.ps1. This is because the it is assumed that the length of the string is at least 6 characters long, which is not always the case.

To Reproduce
Steps to reproduce the behavior:
Use a logicApp definition where the actionName is < 5 characters

Expected behavior
Should not error out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant