Skip to content
Permalink
Browse files

Fix NRE when accessing RxApp.SuspensionHost (#2181)

  • Loading branch information...
worldbeater authored and glennawatson committed Sep 29, 2019
1 parent 5b93917 commit 89c4621c065eb2eabe2823cf809f1119bfc93160
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/ReactiveUI/RxApp.cs
@@ -107,6 +107,7 @@ static RxApp()
});
});

_suspensionHost = new SuspensionHost();
if (ModeDetector.InUnitTestRunner())
{
LogHost.Default.Warn("*** Detected Unit Test Runner, setting MainThreadScheduler to CurrentThread ***");
@@ -124,8 +125,6 @@ static RxApp()
{
_mainThreadScheduler = DefaultScheduler.Instance;
}

SuspensionHost = new SuspensionHost();
}

/// <summary>
@@ -202,12 +201,7 @@ public static IObserver<Exception> DefaultExceptionHandler
/// </summary>
public static ISuspensionHost SuspensionHost
{
get
{
var host = _unitTestSuspensionHost ?? _suspensionHost;
return host;
}

get => _unitTestSuspensionHost ?? _suspensionHost;
set
{
if (ModeDetector.InUnitTestRunner())

0 comments on commit 89c4621

Please sign in to comment.
You can’t perform that action at this time.