mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Null-safeguard RedumpLib conversions
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
- Update to Aaru v5.3.0-rc2
|
||||
- Add .NET 5.0 as build target
|
||||
- Remove .NET Core 3.1 and .NET 5.0 from AppVeyor build artifacts
|
||||
- Null-safeguard RedumpLib conversions
|
||||
|
||||
### 2.1 (2021-07-22)
|
||||
- Enum, no more
|
||||
|
||||
@@ -800,7 +800,7 @@ namespace RedumpLib.Data
|
||||
/// <returns>Category represented by the string, if possible</returns>
|
||||
public static DiscCategory? ToDiscCategory(string category)
|
||||
{
|
||||
switch (category.ToLowerInvariant())
|
||||
switch (category?.ToLowerInvariant())
|
||||
{
|
||||
case "games":
|
||||
return DiscCategory.Games;
|
||||
@@ -849,7 +849,7 @@ namespace RedumpLib.Data
|
||||
/// <returns>DiscType represented by the string, if possible</returns>
|
||||
public static DiscType? ToDiscType(string discType)
|
||||
{
|
||||
switch (discType.ToLowerInvariant())
|
||||
switch (discType?.ToLowerInvariant())
|
||||
{
|
||||
case "bd25":
|
||||
case "bd-25":
|
||||
@@ -1316,7 +1316,7 @@ namespace RedumpLib.Data
|
||||
/// <returns>RedumpSystem represented by the string, if possible</returns>
|
||||
public static RedumpSystem? ToRedumpSystem(string system)
|
||||
{
|
||||
switch (system.ToLowerInvariant())
|
||||
switch (system?.ToLowerInvariant())
|
||||
{
|
||||
#region BIOS Sets
|
||||
|
||||
@@ -2158,7 +2158,7 @@ namespace RedumpLib.Data
|
||||
/// <returns>YesNo represented by the string, if possible</returns>
|
||||
public static YesNo? ToYesNo(string yesno)
|
||||
{
|
||||
switch (yesno.ToLowerInvariant())
|
||||
switch (yesno?.ToLowerInvariant())
|
||||
{
|
||||
case "no":
|
||||
return YesNo.No;
|
||||
|
||||
Reference in New Issue
Block a user