From b9aa7ed8559a62d87b391cba7f51eb637bc62f7b Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 4 Sep 2024 10:44:16 -0700 Subject: [PATCH] [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 --- .../shell/platform/android/android_context_vk_impeller.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/android/android_context_vk_impeller.cc b/engine/src/flutter/shell/platform/android/android_context_vk_impeller.cc index 5d3b49cb39..da2026b2ad 100644 --- a/engine/src/flutter/shell/platform/android/android_context_vk_impeller.cc +++ b/engine/src/flutter/shell/platform/android/android_context_vk_impeller.cc @@ -68,7 +68,7 @@ static std::shared_ptr 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;