Skip to content

Commit 7308be1

Browse files
committed
Update remaining legacy tests, add null handling in commands.
1 parent b42949e commit 7308be1

File tree

3 files changed

+321
-419
lines changed

3 files changed

+321
-419
lines changed

Rubberduck.Core/UI/UnitTesting/Commands/AddTestMethodCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected override bool EvaluateCanExecute(object parameter)
3838

3939
using (var activePane = _vbe.ActiveCodePane)
4040
{
41-
if (activePane == null || activePane.IsWrappingNullReference)
41+
if (activePane?.IsWrappingNullReference ?? true)
4242
{
4343
return false;
4444
}
@@ -69,7 +69,7 @@ protected override void OnExecute(object parameter)
6969
{
7070
using (var pane = _vbe.ActiveCodePane)
7171
{
72-
if (pane.IsWrappingNullReference)
72+
if (pane?.IsWrappingNullReference ?? true)
7373
{
7474
return;
7575
}

Rubberduck.Core/UI/UnitTesting/Commands/AddTestMethodExpectedErrorCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected override bool EvaluateCanExecute(object parameter)
3333
{
3434
using (var pane = _vbe.ActiveCodePane)
3535
{
36-
if (_state.Status != ParserState.Ready || pane.IsWrappingNullReference)
36+
if (_state.Status != ParserState.Ready || pane is null || pane.IsWrappingNullReference)
3737
{
3838
return false;
3939
}
@@ -63,7 +63,7 @@ protected override void OnExecute(object parameter)
6363
{
6464
using (var pane = _vbe.ActiveCodePane)
6565
{
66-
if (pane.IsWrappingNullReference)
66+
if (pane?.IsWrappingNullReference ?? true)
6767
{
6868
return;
6969
}

0 commit comments

Comments
 (0)