servo: Merge #9300 - layout/text.rs: Add assertion for empty fontgroup (from antrik:assert_empty_fontgroup); r=Ms2ger

Source-Repo: https://github.com/servo/servo
Source-Revision: a76de4b0cc2ec1e37539e9d328c9825c9812be78
This commit is contained in:
Olaf Buddenhagen 2016-01-14 13:42:56 +05:01
Родитель b9b11b9e68
Коммит 289efa1b7b
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -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)