diff options
author | Keting Yang <ketyang@microsoft.com> | 2019-09-06 16:29:13 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-06 16:29:13 +0300 |
commit | dd1ae4076f18a56e27b45299dfa9c720bf8a9ca6 (patch) | |
tree | 8908c65bf2fdd806555c347bc5d4dfe63d51f82c /main/src/addins/MonoDevelop.UnitTesting | |
parent | 47534eaef045441c6c0e72ea914aa24812133eee (diff) |
null check for CurrentSelectedSolution
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting')
-rw-r--r-- | main/src/addins/MonoDevelop.UnitTesting/Commands/UnitTestCommands.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Commands/UnitTestCommands.cs b/main/src/addins/MonoDevelop.UnitTesting/Commands/UnitTestCommands.cs index ed0a1e6846..79665c79cc 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Commands/UnitTestCommands.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Commands/UnitTestCommands.cs @@ -74,7 +74,7 @@ namespace MonoDevelop.UnitTesting.Commands { protected override void Run () { - SolutionFolder ob = IdeApp.ProjectOperations.CurrentSelectedSolution.RootFolder; + SolutionFolder ob = IdeApp.ProjectOperations.CurrentSelectedSolution?.RootFolder; if (ob != null) { UnitTest test = UnitTestService.FindRootTest (ob); if (test != null) @@ -84,7 +84,7 @@ namespace MonoDevelop.UnitTesting.Commands protected override void Update (CommandInfo info) { - SolutionFolder ob = IdeApp.ProjectOperations.CurrentSelectedSolution.RootFolder; + SolutionFolder ob = IdeApp.ProjectOperations.CurrentSelectedSolution?.RootFolder; if (ob != null) { UnitTest test = UnitTestService.FindRootTest (ob); info.Enabled = (test != null); @@ -97,7 +97,7 @@ namespace MonoDevelop.UnitTesting.Commands { protected async override void Run () { - SolutionFolder ob = IdeApp.ProjectOperations.CurrentSelectedSolution.RootFolder; + SolutionFolder ob = IdeApp.ProjectOperations.CurrentSelectedSolution?.RootFolder; if (ob != null) { var testGroup = UnitTestService.FindRootTest (ob) as UnitTestGroup; var tests = testGroup.Tests; @@ -121,7 +121,7 @@ namespace MonoDevelop.UnitTesting.Commands protected override void Update (CommandInfo info) { - WorkspaceObject ob = IdeApp.ProjectOperations.CurrentSelectedObject; + SolutionFolder ob = IdeApp.ProjectOperations.CurrentSelectedSolution?.RootFolder; if (ob != null) { UnitTest test = UnitTestService.FindRootTest (ob); info.Enabled = (test != null); |