diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index d882ab2..1fb05ea 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -2656,10 +2656,12 @@ void TestInfo::Run() { test->Run(); } - // Deletes the test object. - impl->os_stack_trace_getter()->UponLeavingGTest(); - internal::HandleExceptionsInMethodIfSupported( - test, &Test::DeleteSelf_, "the test fixture's destructor"); + if (test != NULL) { + // Deletes the test object. + impl->os_stack_trace_getter()->UponLeavingGTest(); + internal::HandleExceptionsInMethodIfSupported( + test, &Test::DeleteSelf_, "the test fixture's destructor"); + } result_.set_elapsed_time(internal::GetTimeInMillis() - start);