Fix possible crashes in null device

This commit is contained in:
Benau 2019-06-29 12:41:56 +08:00
parent c321490a8a
commit a37b300530

View File

@ -308,7 +308,8 @@ void FontManager::shape(const std::u32string& text,
std::vector<std::u32string>* line_data)
{
if (text.empty())
// m_faces can be empty in null device
if (text.empty() || m_faces.empty())
return;
auto lines = StringUtils::split(text, U'\n');