You should hardly expect a null value. As stated in the documentation, if there is no active session for the request (usually you should check this in the query filter chain), a session will be created. If you get a null value from this, I would say that there is a problem in the base OS: not enough memory to create a session will come to mind.
source
share