mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Catch a missing font provider earlier (#3222)
Rather than hitting an assert in platform-independent code, we now trigger an assert closer to the relevant code when the font provider is missing.
This commit is contained in:
parent
5118d0472f
commit
cfe69e4e85
@ -119,6 +119,11 @@ sk_sp<SkTypeface> FontCache::createTypeface(
|
||||
[&response](fonts::FontResponsePtr r) { response = std::move(r); });
|
||||
font_provider.WaitForIncomingResponse();
|
||||
|
||||
FTL_DCHECK(response)
|
||||
<< "Unable to contact the font provider. Did you run "
|
||||
"Flutter in an environment that has a font manager?\n"
|
||||
"See <https://fuchsia.googlesource.com/modular/+/master/README.md>.";
|
||||
|
||||
if (!response)
|
||||
return nullptr;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user