From 535eb308553d9993c7714f184001a8f57f18b858 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Tue, 8 Dec 2015 11:32:30 -0800 Subject: [PATCH] Don't crash when RasterizerMojo::Draw happens without a context If we don't have a context, we can't draw, so bail out early. --- sky/shell/gpu/mojo/rasterizer_mojo.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sky/shell/gpu/mojo/rasterizer_mojo.cc b/sky/shell/gpu/mojo/rasterizer_mojo.cc index 5e346620a7..66a38d044e 100644 --- a/sky/shell/gpu/mojo/rasterizer_mojo.cc +++ b/sky/shell/gpu/mojo/rasterizer_mojo.cc @@ -46,6 +46,10 @@ void RasterizerMojo::ConnectToRasterizer ( void RasterizerMojo::Draw(uint64_t layer_tree_ptr, const DrawCallback& callback) { TRACE_EVENT0("flutter", "RasterizerMojo::Draw"); + if (!context_) { + callback.Run(); + return; + } scoped_ptr layer_tree( reinterpret_cast(layer_tree_ptr)); -- GitLab