From 114e1499f896248f9951dd469d19f4d793c99edc Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 12 May 2023 12:55:05 -0400 Subject: [PATCH] fix some nullable issues --- Models/ContentModel.cs | 4 ++-- Services/FileNoteService.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Models/ContentModel.cs b/Models/ContentModel.cs index 26f2e64..e91d81f 100644 --- a/Models/ContentModel.cs +++ b/Models/ContentModel.cs @@ -2,6 +2,6 @@ namespace BinaryDad.Notes.Models; public class ContentModel { - public ICollection NoteNames { get; set; } - public string Text { get; set; } + public ICollection NoteNames { get; set; } = new List(); + public string Text { get; set; } = string.Empty; } \ No newline at end of file diff --git a/Services/FileNoteService.cs b/Services/FileNoteService.cs index 93c7297..9decc84 100644 --- a/Services/FileNoteService.cs +++ b/Services/FileNoteService.cs @@ -2,8 +2,8 @@ { public class FileNoteService : INoteService { - private readonly string? defaultFileName; - private readonly string? filePath; + private readonly string defaultFileName; + private readonly string filePath; public FileNoteService(IConfiguration configuration) { @@ -39,7 +39,7 @@ File.Delete(filePath); } - private void CheckFile(string noteName) + private void CheckFile(string? noteName) { var filePath = GetFilePath(noteName);