Skip to content

Commit

Permalink
CodeQA pt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
bagusnl committed Jul 13, 2024
1 parent a8e1cd8 commit e8bf71e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public static T LoadWithMagic(byte[] magic, SettingsGameVersionManager versionMa

try
{
string? filePath = versionManager.ConfigFilePath;
string filePath = versionManager.ConfigFilePath;

if (!File.Exists(filePath)) throw new FileNotFoundException("MagicNodeBaseValues config file not found!");
string raw = Sleepy.ReadString(filePath, magic);
Expand Down Expand Up @@ -305,7 +305,7 @@ public T DefaultValue(byte[] magic, SettingsGameVersionManager versionManager, J
public void Save()
{
// Get the file and dir path
string? filePath = GameVersionManager.ConfigFilePath;
string filePath = GameVersionManager.ConfigFilePath;
string? fileDirPath = Path.GetDirectoryName(filePath);

// Create the dir if not exist
Expand All @@ -314,7 +314,7 @@ public void Save()

// Write into the file
string jsonString = SettingsJsonNode.SerializeJsonNode(Context, false, false);
Sleepy.WriteString(filePath!, jsonString, Magic);
Sleepy.WriteString(filePath, jsonString, Magic);
}

public bool Equals(GeneralData? other)
Expand Down
2 changes: 2 additions & 0 deletions CollapseLauncher/Classes/Helper/Metadata/PresetConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ internal class PresetConfig
{
#region Constants

// ReSharper disable once UnusedMember.Local
private const string PrefixRegInstallLocation =
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{0}";

Expand Down Expand Up @@ -473,6 +474,7 @@ private void SetVoiceLanguageID_StarRail(int langID)
if (kvpTemp == null)
return null;

// ReSharper disable once ConstantConditionalAccessQualifier
verData = kvpTemp?.Value;
}

Expand Down

0 comments on commit e8bf71e

Please sign in to comment.