It can be puzzling when you see something like the following getting a NullReferenceException, with “Object reference not set to an instance of an object.”
The actual offending line of code is actually somewhere else in the view. You probably need to try to go through a process of elimination by comment out section of the view code.
It is my case, the cause is the next time when I tried to assign to one of the properties of the model. The property was null, thus the error.