[Impeller] fix NPE when checking known bad driver. (flutter/engine#54959)

context can be null here which is causing https://github.com/flutter/flutter/issues/154622
This commit is contained in:
Jonah Williams
2024-09-04 10:44:16 -07:00
committed by GitHub
parent dd2395fe5d
commit b9aa7ed855

View File

@@ -68,7 +68,7 @@ static std::shared_ptr<impeller::Context> CreateImpellerContext(
FML_LOG(IMPORTANT) << "Using the Impeller rendering backend (Vulkan).";
}
}
if (context->GetDriverInfo()->IsKnownBadDriver()) {
if (context && context->GetDriverInfo()->IsKnownBadDriver()) {
FML_LOG(INFO)
<< "Known bad Vulkan driver encountered, falling back to OpenGLES.";
return nullptr;