Skip to content

Commit

Permalink
Fix null scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPulman committed Nov 18, 2023
1 parent 3d8b07e commit 970f728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class POCOObservableForProperty : ICreatesObservableForProperty
_hasWarned[(type, propertyName)] = true;
}

return Observable.Return(new ObservedChange<object, object?>(sender, expression, default), RxApp.MainThreadScheduler)
return Observable.Return(new ObservedChange<object, object?>(sender, expression, default), RxApp.MainThreadScheduler ?? CurrentThreadScheduler.Instance)
.Concat(Observable<IObservedChange<object, object?>>.Never);
}
}
5 changes: 1 addition & 4 deletions src/ReactiveUI/RxApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ static RxApp()

LogHost.Default.Info("Initializing to normal mode");

if (_mainThreadScheduler is null)
{
_mainThreadScheduler = DefaultScheduler.Instance;
}
_mainThreadScheduler ??= DefaultScheduler.Instance;
}

/// <summary>
Expand Down

0 comments on commit 970f728

Please sign in to comment.