Fixes bug where the method was throwing an exception  instead of returni...

...ng null.