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

[Bug]: Color Splasher enters exception loop when clicking empty "Values" list #2405

Closed
5 tasks done
frank-e-loftus opened this issue Sep 18, 2024 · 1 comment
Closed
5 tasks done
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]

Comments

@frank-e-loftus
Copy link

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

Endless loop of exceptions caused by clicking an empty list.

⌨ Error/Debug Message

************** Exception Text **************
System.ArgumentOutOfRangeException: InvalidArgument=Value of '-1' is not valid for 'index'.
Parameter name: index
   at System.Windows.Forms.ListBox.ObjectCollection.get_Item(Int32 index)
   at Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at CallSite.Target(Closure , CallSite , Object , Object , DrawItemEventArgs )
   at _Scripting_(Object[] , Object , DrawItemEventArgs )
   at System.Windows.Forms.ListBox.OnDrawItem(DrawItemEventArgs e)
   at System.Windows.Forms.ListBox.WmReflectDrawItem(Message& m)
   at System.Windows.Forms.ListBox.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

♻️ To Reproduce

Immediately after starting the command, before selecting a category, click into the "Values" ListBox. An unhandled exception occurs. Clicking continue on the error dialog triggers the exception again and the same error dialog pops up repeatedly. The UI is stuck in a loop of triggering the same exception, with no way to close the Color Splasher window, since its UI is blocked by the error dialog. The only way out is to end the Revit process.

⏲️ Expected behavior

Clicking in an unpopulated ListBox should not trigger an endless loop of exceptions.

If the ListBox reports a selected index of -1, the application should handle this by doing nothing, I presume.

🖥️ Hardware and Software Setup (please complete the following information)

U:\>pyrevit env
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.16.24121+2117" | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "Autodesk Revit 2025" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "2024.0.1" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "2023.0.2" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "2022.1" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "Autodesk Revit 2021" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "2020.2.1 (New Install)" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "2019.2 (Full Install)" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "2018 First Customer Ship" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
master | Product: "2017 First Customer Ship" | Engine: DEFAULT (2711) | Path: "C:\Users\frank\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
LofTools | Type: Unknown | Repo: "" | Installed: "C:\Users\frank\OneDrive - Loftus Engineering\FL\Master REVIT Standards\Automation\pyRevit\LofTools.extension"
==> Default Extension Search Path
C:\Users\frank\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
C:\Users\frank\OneDrive - Loftus Engineering\FL\Master REVIT Standards\Automation\pyRevit
==> Extension Sources - Default
https://github.com/pyrevitlabs/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2025 | Version: 25.0.2.419 | Build: 20240307_1300(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2025\"
2024.0.1 | Version: 24.0.5.432 | Build: 20230411_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2024\"
2023.0.2 | Version: 23.0.20.21 | Build: 20220726_1500(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2023\"
2022.1 | Version: 22.1.1.516 | Build: 20210921_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
Autodesk Revit 2021 | Version: 21.1.21.45 | Build: 20201116_1100(x64) | Language: 1033 | Path: "Revit 2021\"
2020.2.1 (New Install) | Version: 20.2.12.1 | Build: 20200210_1400(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2020\"
2019.2 (Full Install) | Version: 19.2.1.1 | Build: 20190108_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2019\"
2018 First Customer Ship | Version: 18.0.0.420 | Build: 20170223_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2018\"
2017 First Customer Ship | Version: 17.0.416.0 | Build: 20160225_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2017\"
==> Running Revit Instances
PID: 29180 | 2023.0.2 | Version: 23.0.20.21 | Build: 20220726_1500(x64) | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2023"
==> User Environment
Microsoft Windows 10 [Version 10.0.22631]
Executing User: LOFTUSENGINEERI\frank
Active User: LOFTUSENGINEERI\frank
Admin Access: No
%APPDATA%: "C:\Users\frank\AppData\Roaming"
Latest Installed .Net Framework: 4.8
Installed .Net Target Packs: v4.0 v4.5 v4.5.1 v4.5.2 v4.6 v4.6.1 v4.7.2 v4.8 v4.X
Installed .Net-Core Target Packs: v7.0.306
pyRevit CLI v4.8.16.24121+2117.23a0b8cbc4babdeb29a0611e159d017bbe9cbad5

Additional context

I have reproduced this bug in Revit 2022, 2023, and 2024.

@frank-e-loftus frank-e-loftus added the Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class] label Sep 18, 2024
@jmcouffin
Copy link
Contributor

cannot reproduce bug with latest wip installers. I guess it is fixed with next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug that stops user from using the tool or a major portion of pyRevit functionality [class]
Projects
None yet
Development

No branches or pull requests

2 participants