**Alex Uslontsev** created an [issue](https://nhibernate.jira.com/browse/NH-2894) — <time datetime="2011-09-19T19:22:51.974Z" title="2011-09-19T19:22:51.974Z">19th September 2011, 19:22:51</time>: > Pseudocode example > ```csharp > criterial > .SetProjection( Projections.RowCount ) > .SetLockMode( LockMode.NoLock ) > .ToList() > ``` > will raise "object reference not set to an instance of an object" exception. > > > The problem is in the ApplyLocks method in the following line > ```csharp > string[] drivingSqlAliases = Aliases; > for (int i = 0; i < drivingSqlAliases.Length; i<ins></ins>) > ``` > In my case `drivingSqlAliases` is null, and accessing to `drivingSqlAliases.Length` raises this exception > --- **Alexander Zaytsev** added a comment — <time datetime="2013-01-23T03:34:25.729Z" title="2013-01-23T03:34:25.729Z">23rd January 2013, 3:34:25</time>: > Could someone provide a test case? >