Skip to content

Commit

Permalink
layout/text.rs: Add assertion for empty fontgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
antrik committed Jan 14, 2016
1 parent 0b5dda3 commit 422639f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/layout/text.rs
Expand Up @@ -186,6 +186,8 @@ impl TextRunScanner {
// Search for the first font in this font group that contains a glyph for this
// character.
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 {
if fontgroup.fonts.get(font_index).unwrap().borrow()
.glyph_index(character)
Expand Down

0 comments on commit 422639f

Please sign in to comment.