LibKenjinx: Fix possible NullReferenceExceptions

This commit is contained in:
KeatonTheBot
2026-03-09 18:00:40 -05:00
parent ce2f2a14af
commit 72955d1aa4
5 changed files with 57 additions and 48 deletions
+3 -3
View File
@@ -54,12 +54,12 @@ namespace LibKenjinx
public static void InstallFirmware(Stream stream, bool isXci)
{
SwitchDevice?.ContentManager.InstallFirmware(stream, isXci);
SwitchDevice?.ContentManager?.InstallFirmware(stream, isXci);
}
public static string GetInstalledFirmwareVersion()
{
var version = SwitchDevice?.ContentManager.GetCurrentFirmwareVersion();
var version = SwitchDevice?.ContentManager?.GetCurrentFirmwareVersion();
if (version != null)
{
@@ -71,7 +71,7 @@ namespace LibKenjinx
public static SystemVersion? VerifyFirmware(Stream stream, bool isXci)
{
return SwitchDevice?.ContentManager.VerifyFirmwarePackage(stream, isXci) ?? null;
return SwitchDevice?.ContentManager?.VerifyFirmwarePackage(stream, isXci) ?? null;
}
public static bool LoadApplication(Stream stream, FileType type, Stream? updateStream = null)