Skip to content

Commit

Permalink
Null exception on platforms that don't support orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
anaisbetts committed Jun 1, 2013
1 parent da96f40 commit e82358b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ReactiveUI.Platforms/Xaml/RoutedViewHost.cs
Expand Up @@ -72,7 +72,7 @@ public RoutedViewHost()
.Select(_ => platform.GetOrientation())
.DistinctUntilChanged()
.StartWith(platform.GetOrientation())
.Select(x => x.ToString());
.Select(x => x != null ? x.ToString() : default(string));

var vmAndContract = Observable.CombineLatest(
this.WhenAnyObservable(x => x.Router.CurrentViewModel),
Expand Down
2 changes: 1 addition & 1 deletion ReactiveUI.Platforms/Xaml/ViewModelViewHost.cs
Expand Up @@ -68,7 +68,7 @@ public ViewModelViewHost()
.Select(_ => platform.GetOrientation())
.DistinctUntilChanged()
.StartWith(platform.GetOrientation())
.Select(x => x.ToString());
.Select(x => x != null ? x.ToString() : default(string));

vmAndContract.Subscribe(x => {
if (x.ViewModel == null) {
Expand Down

0 comments on commit e82358b

Please sign in to comment.