mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #9300 - antrik:assert_empty_fontgroup, r=Ms2ger
layout/text.rs: Add assertion for empty fontgroup <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9300) <!-- Reviewable:end -->
This commit is contained in:
commit
a76de4b0cc
1 changed files with 2 additions and 0 deletions
|
@ -186,6 +186,8 @@ impl TextRunScanner {
|
||||||
// Search for the first font in this font group that contains a glyph for this
|
// Search for the first font in this font group that contains a glyph for this
|
||||||
// character.
|
// character.
|
||||||
let mut font_index = 0;
|
let mut font_index = 0;
|
||||||
|
// The following code panics one way or another if this condition isn't met.
|
||||||
|
assert!(fontgroup.fonts.len() > 0);
|
||||||
while font_index < fontgroup.fonts.len() - 1 {
|
while font_index < fontgroup.fonts.len() - 1 {
|
||||||
if fontgroup.fonts.get(font_index).unwrap().borrow()
|
if fontgroup.fonts.get(font_index).unwrap().borrow()
|
||||||
.glyph_index(character)
|
.glyph_index(character)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue