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

Crash after splitting a connection with a mismatching type operator #23

Closed
mikcaffa opened this issue Jun 22, 2022 · 2 comments
Closed
Labels
bug An issue that should be fixed. ui Task is related to user interface

Comments

@mikcaffa
Copy link

mikcaffa commented Jun 22, 2022

Describe the bug

Tooll3 lets you create a mismatching type connection by splitting an already existing good connection; then it crashes with a System.ArgumentOutOfRangeException exception while updating the operators.

Please complete the following information:

  • OS: Windows 10 Pro
  • Version: 21H1
  • Graphics card and resolution: nVidia GeForce GTX 1070 Ti, 1920x1080

To Reproduce

Steps to reproduce the behavior:

  1. Add a Value operator
  2. Connect it to the float input of another operator (e.g. RadialGPoints)
  3. Add a disconnected FloatToInt operator
  4. Drag the FloatToInt onto the previous connection to split it
  5. Hover the mouse on the target operator (e.g. RadialGPoints) to update it

Expected behavior

The GUI should check for type mismatching and prevent making the connection.

Additional context

I think the culprit is this if-statement in the ConnectionMaker.SplitConnectionWithDraggedNode method that doesn't seem to check correctly for the type mismatch between the splitting operator and the target operator: https://github.com/still-scene/t3/blob/2750057c245b5f221df7eea1b60840856e6d1cca/T3/Gui/Graph/Interaction/ConnectionMaker.cs#L544-L551 Indeed, it doesn't log a warning nor it returns without doing anything; instead, it goes on and creates the commands needed to make the connection.

Then, while processing the commands, the Slot.AddConnection method detects the type mismatch, logs a warning and returns without adding the source Slot to the InputConnection List of the Slot: https://github.com/still-scene/t3/blob/2b652951903e0398fc2b676eb280d2182222b865/Core/Operator/Slots/Slot.cs#L91-L110

Finally, while executing the Slot.ConnectedUpdate method, Tooll3 crashes on a System.ArgumentOutOfRangeException exception while trying to access index 0 of an empty List: https://github.com/still-scene/t3/blob/2b652951903e0398fc2b676eb280d2182222b865/Core/Operator/Slots/Slot.cs#L79-L82

@pixtur pixtur added bug An issue that should be fixed. ui Task is related to user interface labels Jun 24, 2022
@pixtur
Copy link
Collaborator

pixtur commented Jun 24, 2022

Thanks for this excellent bug reports. Thanks to your research this should be easy to fix.

@pixtur
Copy link
Collaborator

pixtur commented Jul 15, 2022

Fixed in v3.3.0 Thanks again for report.
I wish all bug-reports were of this level.

@pixtur pixtur closed this as completed Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that should be fixed. ui Task is related to user interface
Projects
Status: Done for v3.2
Development

No branches or pull requests

2 participants