diff options
author | Marius Ungureanu <teromario@yahoo.com> | 2016-05-31 23:40:03 +0300 |
---|---|---|
committer | Lluis Sanchez <slluis.devel@gmail.com> | 2016-05-31 23:40:03 +0300 |
commit | 0fcc7a078c1c3757c7039d9a1b1ed80d240f5ec6 (patch) | |
tree | 054c74e8bd0adc96c506fbe682633ec036f5dfd7 /main/src/addins/MonoDevelop.UnitTesting | |
parent | 29eb03090b5b5286f45b8effe918bf93ead6e68b (diff) |
[NUnit] Guard against null execution context on running tests. (#1480)
As per 14872cd219d96421caee9a69935c474488fcf94b, we were no longer
checking whether the passed context was null.
The context we are not assigning as per this change will be fixed up by
TestContext in the constructor and assigned a fallback value.
Bug 41320 - Run Unit Tests from Run Menu isn't working. Shows NRE in log
Diffstat (limited to 'main/src/addins/MonoDevelop.UnitTesting')
-rw-r--r-- | main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs index 5816721bcf..5223c31fac 100644 --- a/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs +++ b/main/src/addins/MonoDevelop.UnitTesting/Services/UnitTestService.cs @@ -402,7 +402,8 @@ namespace MonoDevelop.UnitTesting public TestSession (UnitTest test, MonoDevelop.Projects.ExecutionContext context, TestResultsPad resultsPad, CancellationTokenSource cs) { this.test = test; - this.context = new Projects.ExecutionContext (context.ExecutionHandler, new CustomConsoleFactory (context.ConsoleFactory, cs), context.ExecutionTarget); + if (context != null) + this.context = new Projects.ExecutionContext (context.ExecutionHandler, new CustomConsoleFactory (context.ConsoleFactory, cs), context.ExecutionTarget); CancellationTokenSource = cs; this.monitor = new TestMonitor (resultsPad, CancellationTokenSource); this.resultsPad = resultsPad; |