Skip to content

Commit dc5a1a6

Browse files
committed
Fix null references in set StatusBar shortcuts
1 parent 8f6195e commit dc5a1a6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Operations/StatusBarOperations/SetShortcutOperation.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace TerminalGuiDesigner.Operations.StatusBarOperations
1111
public class SetShortcutOperation : GenericArrayElementOperation<StatusBar, Shortcut>
1212
{
1313
private Key originalShortcut;
14-
private Key? shortcut;
14+
private Key shortcut;
1515

1616
/// <summary>
1717
/// Initializes a new instance of the <see cref="SetShortcutOperation"/> class.
@@ -27,14 +27,14 @@ public SetShortcutOperation(Design design, Shortcut statusItem, Key? shortcut)
2727
design,
2828
statusItem)
2929
{
30-
this.shortcut = shortcut;
30+
this.shortcut = shortcut ?? Key.Empty;
3131
this.originalShortcut = statusItem.Key;
3232
}
3333

3434
/// <inheritdoc/>
3535
protected override void RedoImpl()
3636
{
37-
if (this.shortcut == null)
37+
if (this.shortcut == Key.Empty)
3838
{
3939
return;
4040
}
@@ -51,7 +51,7 @@ protected override void UndoImpl()
5151
/// <inheritdoc/>
5252
protected override bool DoImpl()
5353
{
54-
if (this.shortcut == null)
54+
if (this.shortcut == Key.Empty)
5555
{
5656
this.shortcut = Modals.GetShortcut();
5757
}

src/ViewFactory.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public static class ViewFactory
4747
typeof(Shortcut),
4848

4949
typeof(Tab),
50-
typeof(Bar),
5150
typeof(CharMap),
5251
typeof(LegendAnnotation),
5352
typeof(Menuv2),

0 commit comments

Comments
 (0)