Fix unguarded unwrap when attempting to embed the same default font multiple times in the software renderer glyph embedding pass

Fixes #5684
This commit is contained in:
Simon Hausmann 2024-07-25 09:18:18 +02:00 committed by Simon Hausmann
parent c8a85b9dd9
commit dafa559a55

View file

@ -275,7 +275,9 @@ fn embed_glyphs_with_fontdb<'a>(
// Make sure to embed the default font first, because that becomes the default at run-time.
for path in default_font_paths {
embed_font_by_path_and_face_id(&path, fonts.remove(&path).unwrap());
if let Some(font_id) = fonts.remove(&path) {
embed_font_by_path_and_face_id(&path, font_id);
}
}
for (path, face_id) in &fonts {