Remove null supressions.

This commit is contained in:
2021-08-17 17:19:48 +01:00
parent ad861f5a74
commit 45798d5d00
3 changed files with 7 additions and 7 deletions

View File

@@ -515,7 +515,7 @@ namespace Aaru.Core.Devices.Dumping
CSS_CPRM.LeadInCopyright? cmi = CSS_CPRM.DecodeLeadInCopyright(cmdBuf);
if(cmi!.Value.CopyrightType == CopyrightType.NoProtection)
if(cmi?.CopyrightType == CopyrightType.NoProtection)
UpdateStatus?.Invoke("Drive reports no copy protection on disc.");
else
{
@@ -524,15 +524,15 @@ namespace Aaru.Core.Devices.Dumping
"The dump will be incorrect unless decryption is enabled.");
else
{
if(cmi!.Value.CopyrightType == CopyrightType.CSS)
if(cmi?.CopyrightType == CopyrightType.CSS)
{
UpdateStatus?.Invoke("Drive reports disc uses CSS copy protection.");
dvdDecrypt = new DVDDecryption(_dev);
sense = dvdDecrypt.ReadBusKey(out cmdBuf, out _,
CSS_CPRM.DecodeLeadInCopyright(cmdBuf)!.Value.
CopyrightType, _dev.Timeout, out _);
CSS_CPRM.DecodeLeadInCopyright(cmdBuf)?.
CopyrightType ?? CopyrightType.NoProtection, _dev.Timeout, out _);
if(!sense)
{
@@ -598,7 +598,7 @@ namespace Aaru.Core.Devices.Dumping
else
{
UpdateStatus?.
Invoke($"Drive reports disc uses {CSS_CPRM.DecodeLeadInCopyright(cmdBuf)!.Value.CopyrightType.ToString()} copy protection. " +
Invoke($"Drive reports disc uses {(CSS_CPRM.DecodeLeadInCopyright(cmdBuf)?.CopyrightType ?? CopyrightType.NoProtection).ToString()} copy protection. " +
"This is not yet supported and the dump will be incorrect.");
}
}

View File

@@ -177,7 +177,7 @@ namespace Aaru.Core.Devices.Dumping
_outputPlugin.WriteSectorTag(titleKey.Value.Key, i + j, SectorTagType.DvdTitleKey);
_resume.MissingTitleKeys.Remove(i + j);
CSS.DecryptTitleKey(0, discKey!, titleKey.Value.Key, out tmpBuf);
CSS.DecryptTitleKey(0, discKey, titleKey.Value.Key, out tmpBuf);
_outputPlugin.WriteSectorTag(tmpBuf, i + j, SectorTagType.DvdTitleKeyDecrypted);
}
}

View File

@@ -58,7 +58,7 @@ namespace Aaru.DiscImages
{
_tracks.TryGetValue(track, out Track aaruTrack);
return aaruTrack!.TrackStartSector + relativeSector;
return (aaruTrack?.TrackStartSector ?? 0) + relativeSector;
}
byte[] GetHunk(ulong hunkNo)