Skip to content

Commit

Permalink
Fix issue of ReadingSettings not applying
Browse files Browse the repository at this point in the history
  • Loading branch information
sabihoshi committed Apr 14, 2021
1 parent a6df8db commit 7d66401
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions GenshinLyreMidiPlayer/Core/Errors/ExceptionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ internal static class ExceptionHandler
/// <returns>A <see cref="bool" /> whether reading can continue or not.</returns>
[SuppressMessage("ReSharper", "PossibleNullReferenceException")]
[SuppressMessage("ReSharper", "CheckForReferenceEqualityInstead.1")]
public static async Task<bool> TryHandleException(Exception e, ReadingSettings? settings = null)
public static async Task<bool> TryHandleException(Exception e, ReadingSettings settings)
{
var command = ExceptionOptions
.FirstOrDefault(type =>
Expand All @@ -95,7 +95,6 @@ public static async Task<bool> TryHandleException(Exception e, ReadingSettings?
ContentDialogResult.Secondary => command?.ElementAtOrDefault(1)
};

settings ??= new ReadingSettings();
switch (e)
{
// User selectable policy
Expand Down
4 changes: 2 additions & 2 deletions GenshinLyreMidiPlayer/GenshinLyreMidiPlayer.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<StartupObject>GenshinLyreMidiPlayer.App</StartupObject>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Version>1.6.4</Version>
<Version>1.6.4.1</Version>
<ApplicationIcon>item_windsong_lyre.ico</ApplicationIcon>
<Nullable>enable</Nullable>
<RepositoryUrl>https://github.com/sabihoshi/GenshinLyreMidiPlayer</RepositoryUrl>
Expand Down
3 changes: 2 additions & 1 deletion GenshinLyreMidiPlayer/ViewModels/PlaylistViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -126,6 +126,7 @@ private async Task AddFile(string fileName, ReadingSettings? settings = null)
}
catch (Exception e)
{
settings ??= new ReadingSettings();
if (await ExceptionHandler.TryHandleException(e, settings))
await AddFile(fileName, settings);
}
Expand Down

0 comments on commit 7d66401

Please sign in to comment.