diff --git a/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp index 2670b8d099..c6eecd6afd 100644 --- a/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp +++ b/renderscript/1.0/vts/functional/VtsHalRenderscriptV1_0TargetTest.cpp @@ -28,8 +28,10 @@ void RenderscriptHidlTest::SetUp() { } void RenderscriptHidlTest::TearDown() { - context->contextFinish(); - context->contextDestroy(); + if (context.get() != nullptr) { + context->contextFinish(); + context->contextDestroy(); + } } // A class for test environment setup (kept since this file is a template).