I have an MVC Session which is null (doesn't exist) - I am checking this and want to return user to the "Error" view.
I am however getting a "NullReferenceException" error - have tried link below but to no avail:-
How to check if session value is null or session key does not exist in asp.net mvc - 5
Where am I going wrong?
Screenshots showing code with Error:-