Add nullable context to SabreTools.IO

This commit is contained in:
Matt Nadareski
2023-08-10 15:02:40 -04:00
parent fb81fd0243
commit 7bb0ba245d
22 changed files with 356 additions and 174 deletions

View File

@@ -46,7 +46,7 @@ namespace SabreTools.Serialization
var dat = new MetadataFile();
// Read the header values first
if (!reader.ReadHeader())
if (!reader.ReadHeader() || reader.HeaderValues == null)
return null;
dat.Header = reader.HeaderValues.ToArray();
@@ -56,7 +56,7 @@ namespace SabreTools.Serialization
while (!reader.EndOfStream)
{
// If we have no next line
if (!reader.ReadNextLine())
if (!reader.ReadNextLine() || reader.Line == null)
break;
// Parse the line into a row