Skip to content

Commit fea6393

Browse files
authored
housekeeping: Update version and fix nullability issues (#2738)
* housekeeping: Change the non-package repos * housekeeping: Update versions and fix nullability issues
1 parent b5b54aa commit fea6393

File tree

12 files changed

+42
-12
lines changed

12 files changed

+42
-12
lines changed

src/Directory.build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
</ItemGroup>
6060

6161
<ItemGroup>
62-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.190" PrivateAssets="all" />
62+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.194" PrivateAssets="all" />
6363
</ItemGroup>
6464

6565
<ItemGroup>
66-
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.321" PrivateAssets="all" />
66+
<PackageReference Include="stylecop.analyzers" Version="1.2.0-beta.333" PrivateAssets="all" />
6767
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="all" />
6868
<PackageReference Include="Roslynator.Analyzers" Version="3.1.0" PrivateAssets="All" />
6969
</ItemGroup>

src/ReactiveUI.Blazor/ReactiveUI.Blazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</ItemGroup>
1717

1818
<ItemGroup Condition=" $(TargetFramework.StartsWith('net5')) ">
19-
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.3" />
19+
<PackageReference Include="Microsoft.AspNetCore.Components" Version="5.0.5" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

src/ReactiveUI.Drawing/ReactiveUI.Drawing.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Splat.Drawing" Version="10.*" />
18+
<PackageReference Include="Splat.Drawing" Version="11.*" />
1919
</ItemGroup>
2020
</Project>

src/ReactiveUI.Fody.Helpers/ReactiveUI.Fody.Helpers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<ItemGroup>
2020
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="None" />
21-
<PackageReference Include="FodyPackaging" Version="6.5.0" PrivateAssets="All" />
21+
<PackageReference Include="FodyPackaging" Version="6.5.1" PrivateAssets="All" />
2222
<PackageReference Include="System.Reactive" Version="5.0.0" />
2323
</ItemGroup>
2424

src/ReactiveUI.Splat.Tests/ReactiveUI.Splat.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Splat.Autofac" Version="10.*" />
13-
<PackageReference Include="Splat.DryIoc" Version="10.*" />
14-
<PackageReference Include="Splat.Ninject" Version="10.*" />
12+
<PackageReference Include="Splat.Autofac" Version="11.*" />
13+
<PackageReference Include="Splat.DryIoc" Version="11.*" />
14+
<PackageReference Include="Splat.Ninject" Version="11.*" />
1515
</ItemGroup>
1616

1717
<ItemGroup>
1818
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj" />
1919
</ItemGroup>
2020

21-
</Project>
21+
</Project>

src/ReactiveUI.XamForms.Tests/Mocks/ChildViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System;
7+
68
using Splat;
79

810
namespace ReactiveUI.XamForms.Tests.Mocks
@@ -15,7 +17,7 @@ public class ChildViewModel : ReactiveObject, IRoutableViewModel
1517
/// <summary>
1618
/// Initializes a new instance of the <see cref="ChildViewModel"/> class.
1719
/// </summary>
18-
public ChildViewModel() => HostScreen = Locator.Current.GetService<IScreen>();
20+
public ChildViewModel() => HostScreen = Locator.Current.GetService<IScreen>() ?? throw new InvalidOperationException("There is no valid screens");
1921

2022
/// <summary>
2123
/// Initializes a new instance of the <see cref="ChildViewModel"/> class.

src/ReactiveUI.XamForms.Tests/Mocks/MainViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// The .NET Foundation licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System;
7+
68
using Splat;
79

810
namespace ReactiveUI.XamForms.Tests.Mocks
@@ -15,7 +17,7 @@ public class MainViewModel : ReactiveObject, IRoutableViewModel
1517
/// <summary>
1618
/// Initializes a new instance of the <see cref="MainViewModel"/> class.
1719
/// </summary>
18-
public MainViewModel() => HostScreen = Locator.Current.GetService<IScreen>();
20+
public MainViewModel() => HostScreen = Locator.Current.GetService<IScreen>() ?? throw new InvalidOperationException("There is no valid screen");
1921

2022
/// <inheritdoc/>
2123
public string? UrlPathSegment => "Main view";

src/ReactiveUI.XamForms.Tests/Mocks/NavigationViewModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
using System;
77
using System.Reactive;
8+
using System.Reactive.Linq;
9+
810
using Splat;
911

1012
namespace ReactiveUI.XamForms.Tests.Mocks
@@ -25,6 +27,12 @@ public class NavigationViewModel : ReactiveObject, IScreen
2527
public IObservable<IRoutableViewModel> Navigate(string name)
2628
{
2729
var viewModel = Locator.Current.GetService<IRoutableViewModel>(name);
30+
31+
if (viewModel is null)
32+
{
33+
return Observable.Throw<IRoutableViewModel>(new InvalidOperationException("Could not find the view model with the name."));
34+
}
35+
2836
return Router.Navigate.Execute(viewModel);
2937
}
3038

src/ReactiveUI.XamForms.Tests/RoutedViewHostTest.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ private RoutedViewHost CreateRoutedViewHost(string? initialViewModel = nameof(Ma
360360
if (initialViewModel is not null)
361361
{
362362
var mainViewModel = Locator.Current.GetService<IRoutableViewModel>(initialViewModel);
363+
364+
if (mainViewModel is null)
365+
{
366+
throw new InvalidOperationException("There should be a valid view model.");
367+
}
368+
363369
_navigationViewModel.Router.NavigationStack.Add(mainViewModel);
364370
}
365371

src/ReactiveUI/ObservableForProperty/ObservableAsPropertyHelper.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public sealed class ObservableAsPropertyHelper<T> : IHandleObservableErrors, IDi
5858
public ObservableAsPropertyHelper(
5959
IObservable<T> observable,
6060
Action<T> onChanged,
61+
#pragma warning disable CS8601 // Possible null reference assignment.
6162
T initialValue = default,
63+
#pragma warning restore CS8601 // Possible null reference assignment.
6264
bool deferSubscription = false,
6365
IScheduler? scheduler = null)
6466
: this(observable, onChanged, null, initialValue, deferSubscription, scheduler)
@@ -96,7 +98,9 @@ public ObservableAsPropertyHelper(
9698
IObservable<T> observable,
9799
Action<T> onChanged,
98100
Action<T>? onChanging = null,
101+
#pragma warning disable CS8601 // Possible null reference assignment.
99102
T initialValue = default,
103+
#pragma warning restore CS8601 // Possible null reference assignment.
100104
bool deferSubscription = false,
101105
IScheduler? scheduler = null)
102106
: this(observable, onChanged, onChanging, () => initialValue, deferSubscription, scheduler)
@@ -235,7 +239,9 @@ public T Value
235239
/// normally be a Dispatcher-based scheduler.
236240
/// </param>
237241
/// <returns>A default property helper.</returns>
242+
#pragma warning disable CS8601 // Possible null reference assignment.
238243
public static ObservableAsPropertyHelper<T> Default(T initialValue = default, IScheduler? scheduler = null) =>
244+
#pragma warning restore CS8601 // Possible null reference assignment.
239245
new ObservableAsPropertyHelper<T>(Observable<T>.Never, _ => { }, initialValue!, false, scheduler);
240246

241247
/// <summary>

0 commit comments

Comments
 (0)