diff --git a/Compression.BSA/BA2Builder.cs b/Compression.BSA/BA2Builder.cs index 2e366a80..f9a2e346 100644 --- a/Compression.BSA/BA2Builder.cs +++ b/Compression.BSA/BA2Builder.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using ICSharpCode.SharpZipLib.Zip.Compression; using ICSharpCode.SharpZipLib.Zip.Compression.Streams; using Wabbajack.Common; +#nullable disable namespace Compression.BSA { diff --git a/Compression.BSA/BA2Reader.cs b/Compression.BSA/BA2Reader.cs index 32e5639e..d6c6137b 100644 --- a/Compression.BSA/BA2Reader.cs +++ b/Compression.BSA/BA2Reader.cs @@ -8,6 +8,7 @@ using ICSharpCode.SharpZipLib.Zip.Compression; using Wabbajack.Common; using Wabbajack.Common.Serialization.Json; using File = Alphaleonis.Win32.Filesystem.File; +#nullable disable namespace Compression.BSA { diff --git a/Compression.BSA/BSA/Builder/BSABuilder.cs b/Compression.BSA/BSA/Builder/BSABuilder.cs index d04f000b..c4c84eea 100644 --- a/Compression.BSA/BSA/Builder/BSABuilder.cs +++ b/Compression.BSA/BSA/Builder/BSABuilder.cs @@ -10,6 +10,7 @@ using K4os.Compression.LZ4.Streams; using Wabbajack.Common; using File = Alphaleonis.Win32.Filesystem.File; using Path = Alphaleonis.Win32.Filesystem.Path; +#nullable disable namespace Compression.BSA { diff --git a/Compression.BSA/BSA/Reader/BSAReader.cs b/Compression.BSA/BSA/Reader/BSAReader.cs index 199ab80d..c1657a24 100644 --- a/Compression.BSA/BSA/Reader/BSAReader.cs +++ b/Compression.BSA/BSA/Reader/BSAReader.cs @@ -18,8 +18,8 @@ namespace Compression.BSA internal AbsolutePath _fileName; internal uint _folderCount; internal uint _folderRecordOffset; - private Lazy _folders; - internal string _magic; + private Lazy _folders = null!; + internal string _magic = string.Empty; internal uint _totalFileNameLength; internal uint _totalFolderNameLength; diff --git a/Compression.BSA/BSA/Reader/BSAStateObject.cs b/Compression.BSA/BSA/Reader/BSAStateObject.cs index 0f3783ac..2d1852dc 100644 --- a/Compression.BSA/BSA/Reader/BSAStateObject.cs +++ b/Compression.BSA/BSA/Reader/BSAStateObject.cs @@ -10,13 +10,13 @@ namespace Compression.BSA [JsonName("BSAState")] public class BSAStateObject : ArchiveStateObject { - public string Magic { get; set; } + public string Magic { get; set; } = string.Empty; public uint Version { get; set; } public uint ArchiveFlags { get; set; } public uint FileFlags { get; set; } public BSAStateObject() - { + { } public BSAStateObject(BSAReader bsaReader) @@ -25,7 +25,6 @@ namespace Compression.BSA Version = (uint)bsaReader.HeaderType; ArchiveFlags = (uint)bsaReader.ArchiveFlags; FileFlags = (uint)bsaReader.FileFlags; - } public override async Task MakeBuilder(long size) diff --git a/Compression.BSA/BSA/Reader/FolderRecord.cs b/Compression.BSA/BSA/Reader/FolderRecord.cs index 00be479c..ce9bb18d 100644 --- a/Compression.BSA/BSA/Reader/FolderRecord.cs +++ b/Compression.BSA/BSA/Reader/FolderRecord.cs @@ -13,11 +13,11 @@ namespace Compression.BSA { internal readonly BSAReader BSA; private readonly ReadOnlyMemorySlice _data; - internal Lazy _files; + internal Lazy _files = null!; private int _prevFileCount; - internal FileNameBlock FileNameBlock; + internal FileNameBlock FileNameBlock = null!; internal int Index { get; } - public string Name { get; private set; } + public string? Name { get; private set; } public IEnumerable Files => _files.Value; diff --git a/Compression.BSA/Compression.BSA.csproj b/Compression.BSA/Compression.BSA.csproj index 4c68b680..4517d254 100644 --- a/Compression.BSA/Compression.BSA.csproj +++ b/Compression.BSA/Compression.BSA.csproj @@ -6,6 +6,8 @@ x64 win10-x64 3.0 + enable + nullable true $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb diff --git a/Compression.BSA/Interfaces/IFolder.cs b/Compression.BSA/Interfaces/IFolder.cs index a3da1107..0b2794a3 100644 --- a/Compression.BSA/Interfaces/IFolder.cs +++ b/Compression.BSA/Interfaces/IFolder.cs @@ -6,7 +6,7 @@ namespace Compression.BSA { public interface IFolder { - string Name { get; } + string? Name { get; } IEnumerable Files { get; } int FileCount { get; } } diff --git a/Compression.BSA/TES3Reader.cs b/Compression.BSA/TES3Reader.cs index b57d38cf..0ebe34f6 100644 --- a/Compression.BSA/TES3Reader.cs +++ b/Compression.BSA/TES3Reader.cs @@ -5,6 +5,7 @@ using System.Text; using System.Threading.Tasks; using Wabbajack.Common; using Wabbajack.Common.Serialization.Json; +#nullable disable namespace Compression.BSA {