mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PTRun][Registry] Enable analyzer and fix warnings (#16941)
This commit is contained in:
committed by
GitHub
parent
b1b1f1ba21
commit
94391775c8
@@ -167,7 +167,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.Equals(subKey, searchSubKey, StringComparison.InvariantCultureIgnoreCase))
|
if (string.Equals(subKey, searchSubKey, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var key = parentKey.OpenSubKey(subKey, RegistryKeyPermissionCheck.ReadSubTree);
|
var key = parentKey.OpenSubKey(subKey, RegistryKeyPermissionCheck.ReadSubTree);
|
||||||
if (key != null)
|
if (key != null)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Registry.Helper
|
|||||||
|
|
||||||
if (unformattedValue == null)
|
if (unformattedValue == null)
|
||||||
{
|
{
|
||||||
throw new NullReferenceException(nameof(unformattedValue));
|
throw new InvalidOperationException($"Cannot proceed when {nameof(unformattedValue)} is null.");
|
||||||
}
|
}
|
||||||
|
|
||||||
var valueData = key.GetValueKind(valueName) switch
|
var valueData = key.GetValueKind(valueName) switch
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
<NeutralLanguage>en-US</NeutralLanguage>
|
<NeutralLanguage>en-US</NeutralLanguage>
|
||||||
<LangVersion>8.0</LangVersion>
|
<LangVersion>8.0</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||||
|
<AnalysisMode>Recommended</AnalysisMode>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
|||||||
Reference in New Issue
Block a user