diff options
Diffstat (limited to 'tests/FontHostStreamTest.cpp')
-rw-r--r-- | tests/FontHostStreamTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/FontHostStreamTest.cpp b/tests/FontHostStreamTest.cpp index c3bc878da8..e97ea0dcc2 100644 --- a/tests/FontHostStreamTest.cpp +++ b/tests/FontHostStreamTest.cpp @@ -88,6 +88,12 @@ DEF_TEST(FontHostStream, reporter) { : SkTypeface::MakeDefault()); int ttcIndex; std::unique_ptr<SkStreamAsset> fontData(typeface->openStream(&ttcIndex)); + if (!fontData) { + // We're using a SkTypeface that can't give us a stream. + // This happens with portable or system fonts. End the test now. + return; + } + sk_sp<SkTypeface> streamTypeface(SkTypeface::MakeFromStream(fontData.release())); SkFontDescriptor desc; |