Skip to content

Commit

Permalink
Fix crash in text layout when GetMinikinFontCollectionForStyle return…
Browse files Browse the repository at this point in the history
…s null. (flutter#6139)
  • Loading branch information
chinmaygarde authored Sep 2, 2018
1 parent 0f7bfea commit db3484f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions third_party/txt/src/txt/paragraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,9 @@ Paragraph::GetMinikinFontCollectionForStyle(const TextStyle& style) {
sk_sp<SkTypeface> Paragraph::GetDefaultSkiaTypeface(const TextStyle& style) {
std::shared_ptr<minikin::FontCollection> collection =
GetMinikinFontCollectionForStyle(style);
if (!collection) {
return nullptr;
}
minikin::FakedFont faked_font =
collection->baseFontFaked(GetMinikinFontStyle(style));
return static_cast<FontSkia*>(faked_font.font)->GetSkTypeface();
Expand Down

0 comments on commit db3484f

Please sign in to comment.