From 11cedc24832c94c5792c2dfc862bf2efc8f3a591 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Tue, 17 Aug 2021 17:35:43 +0100 Subject: [PATCH] Conditional access is known to be not null. --- Aaru.Core/Devices/Report/Scsi.cs | 32 ++++++++++++++++---------------- Aaru.Core/Logging/ErrorLog.cs | 8 ++++---- Aaru.Decryption | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Aaru.Core/Devices/Report/Scsi.cs b/Aaru.Core/Devices/Report/Scsi.cs index 8d4419124..d4a7a9da1 100644 --- a/Aaru.Core/Devices/Report/Scsi.cs +++ b/Aaru.Core/Devices/Report/Scsi.cs @@ -548,11 +548,11 @@ namespace Aaru.Core.Devices.Report { mediaTest.SupportsReadLong = true; - bool valid = decSense?.Fixed?.InformationValid == true; - bool ili = decSense?.Fixed?.ILI == true; - uint information = decSense?.Fixed?.Information ?? 0; + bool valid = decSense.Value.Fixed?.InformationValid == true; + bool ili = decSense.Value.Fixed?.ILI == true; + uint information = decSense.Value.Fixed?.Information ?? 0; - if(decSense?.Descriptor.HasValue == true && + if(decSense.Value.Descriptor.HasValue && decSense.Value.Descriptor.Value.Descriptors.TryGetValue(0, out byte[] desc00)) { valid = true; @@ -578,11 +578,11 @@ namespace Aaru.Core.Devices.Report { mediaTest.SupportsReadLong16 = true; - bool valid = decSense?.Fixed?.InformationValid == true; - bool ili = decSense?.Fixed?.ILI == true; - uint information = decSense?.Fixed?.Information ?? 0; + bool valid = decSense.Value.Fixed?.InformationValid == true; + bool ili = decSense.Value.Fixed?.ILI == true; + uint information = decSense.Value.Fixed?.Information ?? 0; - if(decSense?.Descriptor.HasValue == true && + if(decSense.Value.Descriptor.HasValue && decSense.Value.Descriptor.Value.Descriptors.TryGetValue(0, out byte[] desc00)) { valid = true; @@ -821,11 +821,11 @@ namespace Aaru.Core.Devices.Report { capabilities.SupportsReadLong = true; - bool valid = decSense?.Fixed?.InformationValid == true; - bool ili = decSense?.Fixed?.ILI == true; - uint information = decSense?.Fixed?.Information ?? 0; + bool valid = decSense.Value.Fixed?.InformationValid == true; + bool ili = decSense.Value.Fixed?.ILI == true; + uint information = decSense.Value.Fixed?.Information ?? 0; - if(decSense?.Descriptor.HasValue == true && + if(decSense.Value.Descriptor.HasValue && decSense.Value.Descriptor.Value.Descriptors.TryGetValue(0, out byte[] desc00)) { valid = true; @@ -852,11 +852,11 @@ namespace Aaru.Core.Devices.Report { capabilities.SupportsReadLong16 = true; - bool valid = decSense?.Fixed?.InformationValid == true; - bool ili = decSense?.Fixed?.ILI == true; - uint information = decSense?.Fixed?.Information ?? 0; + bool valid = decSense.Value.Fixed?.InformationValid == true; + bool ili = decSense.Value.Fixed?.ILI == true; + uint information = decSense.Value.Fixed?.Information ?? 0; - if(decSense?.Descriptor.HasValue == true && + if(decSense.Value.Descriptor.HasValue && decSense.Value.Descriptor.Value.Descriptors.TryGetValue(0, out byte[] desc00)) { valid = true; diff --git a/Aaru.Core/Logging/ErrorLog.cs b/Aaru.Core/Logging/ErrorLog.cs index 9c0d52eb4..4d7ddcc78 100644 --- a/Aaru.Core/Logging/ErrorLog.cs +++ b/Aaru.Core/Logging/ErrorLog.cs @@ -389,13 +389,13 @@ namespace Aaru.Core.Logging prettySense = prettySense.Replace("\n", " - "); _logSw.WriteLine("SCSI command {0} error: SENSE {1} ASC {2:X2}h ASCQ {3:X2}h, {4}, {5}.", command, - decodedSense?.SenseKey, decodedSense?.ASC, decodedSense?.ASCQ, hexSense, + decodedSense.Value.SenseKey, decodedSense.Value.ASC, decodedSense.Value.ASCQ, hexSense, prettySense); } else { _logSw.WriteLine("SCSI command {0} error: SENSE {1} ASC {2:X2}h ASCQ {3:X2}h, {4}.", command, - decodedSense?.SenseKey, decodedSense?.ASC, decodedSense?.ASCQ, hexSense); + decodedSense.Value.SenseKey, decodedSense.Value.ASC, decodedSense.Value.ASCQ, hexSense); } } else @@ -456,13 +456,13 @@ namespace Aaru.Core.Logging prettySense = prettySense.Replace("\n", " - "); _logSw.WriteLine("SCSI reading LBA {0} error: SENSE {1} ASC {2:X2}h ASCQ {3:X2}h, {4}, {5}.", block, - decodedSense?.SenseKey, decodedSense?.ASC, decodedSense?.ASCQ, hexSense, + decodedSense.Value.SenseKey, decodedSense.Value.ASC, decodedSense.Value.ASCQ, hexSense, prettySense); } else { _logSw.WriteLine("SCSI reading LBA {0} error: SENSE {1} ASC {2:X2}h ASCQ {3:X2}h, {4}.", block, - decodedSense?.SenseKey, decodedSense?.ASC, decodedSense?.ASCQ, hexSense); + decodedSense.Value.SenseKey, decodedSense.Value.ASC, decodedSense.Value.ASCQ, hexSense); } } else diff --git a/Aaru.Decryption b/Aaru.Decryption index a835c0272..73b212d3b 160000 --- a/Aaru.Decryption +++ b/Aaru.Decryption @@ -1 +1 @@ -Subproject commit a835c0272729dac5153f71b8778009222803140f +Subproject commit 73b212d3bb730fc67876e3f42bd22d1426289c1c