getting warning: CS8618 - Non-nullable variable must contain a non-null value when exiting construct - C#