Migitated some null risks

This commit is contained in:
schnulller
2022-06-19 01:58:07 +02:00
parent 4f7f3b5d46
commit d8a4fe7790
11 changed files with 30 additions and 29 deletions

View File

@@ -72,11 +72,11 @@ public class HaDocumentWrapper : IHaDocumentWrappper {
rd.Read();
if (state.Results != null)
res.Add((
letter.Index,
letter.Index,
state.Results.Select(x => (
x.Page,
x.Line,
parser.Lines != null ?
x.Page,
x.Line,
parser.Lines != null ?
parser.Lines
.Where(y => y.Page == x.Page && y.Line == x.Line)
.Select(x => x.Text)

View File

@@ -7,5 +7,5 @@ public interface IHaDocumentWrappper {
public ILibrary ResetLibrary();
public ILibrary? SetLibrary(string filepath, ModelStateDictionary ModelState);
public ILibrary GetLibrary();
public List<(string Index, List<(string Page, string Line, string Preview)> Results)>? SearchLetters(string searchword, IReaderService reader);
public List<(string Index, List<(string Page, string Line, string Preview)> Results)>? SearchLetters(string searchword, IReaderService reader);
}