Fix VS2013 "dereferencing null ptr" static analysis error