-
Notifications
You must be signed in to change notification settings - Fork 672
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
v2 - Null reference in SelectedTab setter during RemoveTab
call
#3365
Comments
That isn't the current code. Terminal.Gui/Terminal.Gui/Views/TabView.cs Lines 145 to 186 in 43e4a83
|
Strange, I get this in 710 and 720, maybe 2.0.0-pre.720 was released from a different branch? |
I don't know. You have to wait from the @tig response. |
Good catch. Maybe the |
Here is a unit test [Fact]
public void RemoveTab_ThatHasFocus ()
{
TabView tv = GetTabView (out Tab tab1, out Tab tab2);
tv.SelectedTab = tab2;
tab2.HasFocus = true;
Assert.Equal (2, tv.Tabs.Count);
foreach(var t in tv.Tabs.ToArray())
{
tv.RemoveTab(t);
}
Assert.Equal (0, tv.Tabs.Count);
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();
}
|
Even if |
Looks like it would work :)
…On Sun, 31 Mar 2024, 21:13 BDisp, ***@***.***> wrote:
Even if old?.HasFocus == true that doesn't main that there is currently
any tab. Do you think SelectedTab?.SetFocus (); is enough?
—
Reply to this email directly, view it on GitHub
<#3365 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHO3C5GFDP4M5FI72Y6V7N3Y3BVANAVCNFSM6AAAAABFQUD75KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRYHA4TGOBUGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Fixes #3365 - Fix null reference removing tab
Describe the bug
I am updating designer from v2 pre.250 to v2 pre.710.
It seems there has been some changes to TabView, I am now getting a null reference in RemoveTab (within the setter on SelectedTab).
To Reproduce
Run
TestMoveTab_DoUndo
in TGDExpected behavior
No crash
The text was updated successfully, but these errors were encountered: