From be4a95fe91fc9823e19f7920f0b5e129630080a7 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 24 Apr 2024 00:30:03 -0400 Subject: [PATCH] Handle nullable better --- SabreTools.Serialization/Wrappers/InstallShieldCabinet.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SabreTools.Serialization/Wrappers/InstallShieldCabinet.cs b/SabreTools.Serialization/Wrappers/InstallShieldCabinet.cs index 13734eb6..941410ae 100644 --- a/SabreTools.Serialization/Wrappers/InstallShieldCabinet.cs +++ b/SabreTools.Serialization/Wrappers/InstallShieldCabinet.cs @@ -18,22 +18,22 @@ namespace SabreTools.Serialization.Wrappers /// /// Number of components in the cabinet set /// - public int ComponentCount => Model.Components!.Length; + public int ComponentCount => Model.Components?.Length ?? 0; /// /// Number of directories in the cabinet set /// - public ushort DirectoryCount => Model.Descriptor!.DirectoryCount; + public ushort DirectoryCount => Model.Descriptor?.DirectoryCount ?? 0; /// /// Number of files in the cabinet set /// - public uint FileCount => Model.Descriptor!.FileCount; + public uint FileCount => Model.Descriptor?.FileCount ?? 0; /// /// Number of file groups in the cabinet set /// - public int FileGroupCount => Model.FileGroups!.Length; + public int FileGroupCount => Model.FileGroups?.Length ?? 0; /// /// The major version of the cabinet