When my Database.defaultCard list is empty, it sends null into FirstOrDefault done (I know so). But when sending null value, it doesn't enter else block and An unhandled exception of type 'System.NullReferenceException' occurred in ToDo_App.dll: 'Object reference not set to an instance of an object.' I get an error. No matter what I did, it didn't go into the else block. How can I solve this or if there is something I need to know, can you write?
string done = Database.defaultCard.FirstOrDefault(x => x.Line == "DONE").Line;
if (done!=null)
{
ListingProgressNotNull(done);
}
else
{
done = "DONE";
ListingProgressNull(done);
}