From fe6f3ab33a366298e6a3faa6e71dc16588cf760b Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 9 Nov 2017 10:04:41 -0800 Subject: [PATCH] In GetTexture, do not insert missing IDs into the texture registry map (#4339) Fixes https://github.com/flutter/flutter/issues/12924 --- flow/texture.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flow/texture.cc b/flow/texture.cc index 57e8ce1c6..33a48af98 100644 --- a/flow/texture.cc +++ b/flow/texture.cc @@ -36,7 +36,8 @@ void TextureRegistry::OnGrContextDestroyed() { std::shared_ptr TextureRegistry::GetTexture(int64_t id) { ASSERT_IS_GPU_THREAD - return mapping_[id]; + auto it = mapping_.find(id); + return it != mapping_.end() ? it->second : nullptr; } Texture::Texture(int64_t id) : id_(id) {} -- GitLab