Fix issues with nullability and netstandard2.0

This commit is contained in:
Patrik Svensson
2022-11-10 10:21:05 +01:00
committed by Patrik Svensson
parent 7dce4af552
commit a70cc90797
7 changed files with 48 additions and 28 deletions

View File

@ -5,14 +5,20 @@ internal static class FigletFontParser
public static FigletFont Parse(string source)
{
var lines = source.SplitLines();
var header = ParseHeader(lines.FirstOrDefault());
var characters = new List<FigletCharacter>();
var headerLine = lines.FirstOrDefault();
if (headerLine == null)
{
throw new InvalidOperationException("Could not read header line");
}
var header = ParseHeader(headerLine);
var index = 32;
var indexOverridden = false;
var hasOverriddenIndex = false;
var buffer = new List<string>();
var characters = new List<FigletCharacter>();
foreach (var line in lines.Skip(header.CommentLines + 1))
{

View File

@ -107,8 +107,7 @@ public sealed class TableRowCollection : IReadOnlyList<TableRow>
throw new IndexOutOfRangeException("Table row index cannot exceed the number of rows in the table.");
}
var tableRow = _list.ElementAtOrDefault(row);
var tableRow = _list.ElementAt(row);
var currentRenderables = tableRow.ToList();
if (column < 0)