fix: try getting font index which is hit by comemo (#1213)

This commit is contained in:
Myriad-Dreamin 2025-01-27 09:58:24 +08:00 committed by GitHub
parent 5ee0e4e21d
commit 86d3b912d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -158,7 +158,7 @@ impl FontResolver for TinymistFontResolver {
}
fn font(&self, idx: usize) -> Option<Font> {
self.fonts[idx].get_or_init()
self.fonts.get(idx)?.get_or_init()
}
fn get_by_info(&self, info: &FontInfo) -> Option<Font> {