I am trying to make this code work by checking if there is a movie id in the link so it will render different text than if there is no id
@if (Model.Movie.Id != null)
I am trying to make this code work by checking if there is a movie id in the link so it will render different text than if there is no id
@if (Model.Movie.Id != null)
Your Model.Movie object must be null in some cases, attempting to check a property of a null value will throw that error.
You could try doing this instead so you check Movie and THEN check the id:
@if (Model.Movie != null && Model.Movie.Id != null)