Fixed null pointer dereference.

Using of m_connection and moving it in the same statement is a bad idea.