If stupidity was money, I would be rich

time to read 2 min | 229 words

Here is a crash report that I got from NH Prof error reporting:

System.NullReferenceException: Object reference not set to an instance of an object.
  at HibernatingRhinos.NHibernate.Profiler.Client.Model.Sessions.RecentStatements.set_SelectedStatement(IStatementModel value)
  at HibernatingRhinos.NHibernate.Profiler.Client.Model.Sessions.RecentStatements.Clear()
  at HibernatingRhinos.NHibernate.Profiler.Client.Model.SessionPresenter.Clear()
  at HibernatingRhinos.NHibernate.Profiler.Client.Model.ApplicationModel.Clear()
  at HibernatingRhinos.NHibernate.Profiler.Client.Commands.Clear.Execute(Object parameter)

This seems to be pretty standard, isn’t it? Let us look at SelectedStatement:


There isn’t a possibility of a null reference exception, even the RaisePropertyChanged is safe from NRE.

So, what was going on? I started dismissing this as a ghost story, but I got several issues of those. Then I remember that I am not the only on working on the profiler (well, that is a lie, I got a ‘someone else updated this file’ when I tried to commit) and updated. Here is the updated version:


And there is was, right on the third line in the set.

Lesson learned? Don’t be stupid, svn update.