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

Shortcut crashes when removed from SuperView and ColorScheme set to null #3664

Closed
tznind opened this issue Aug 17, 2024 · 1 comment · Fixed by #3666
Closed

Shortcut crashes when removed from SuperView and ColorScheme set to null #3664

tznind opened this issue Aug 17, 2024 · 1 comment · Fixed by #3666
Labels
Milestone

Comments

@tznind
Copy link
Collaborator

tznind commented Aug 17, 2024

Describe the bug
Manifests in TGD when trying to delete a Shortcut

image

Error
Value cannot be null. (Parameter 'scheme')
   at System.ArgumentNullException.Throw(String paramName)
   at System.ArgumentNullException.ThrowIfNull(Object argument, String param
Name)
   at Terminal.Gui.ColorScheme..ctor(ColorScheme scheme)
   at Terminal.Gui.Shortcut.SetColors()
   at Terminal.Gui.Shortcut.set_ColorScheme(ColorScheme value)
   at TerminalGuiDesigner.SelectionManager.Clear(Boolean respectLock) in D:\
Repos\TerminalGuiDesigner\src\SelectionManager.cs:line 105
   at TerminalGuiDesigner.Operations.DeleteViewOperation.DoImpl() in D:\Rep
...

To Reproduce
Steps to reproduce the behavior:

  1. Add a Shortcut to view area
  2. Select it with rectangle selection
  3. Press Delete
  4. See error

Expected behavior
SetColors should handle this situation

Basically more null handling in SetColors please such that if base.ColorScheme is null it doesn't bomb

@tig tig added the bug label Aug 17, 2024
@tig tig added this to the V2 Alpha milestone Aug 17, 2024
@tig
Copy link
Collaborator

tig commented Aug 17, 2024

@tznind when you file bugs, can you please set the label, project, and milestone so I don't have to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants