Fix segfault on invalid UTF-8 when generating preview
This commit is contained in:
parent
f6e270f83d
commit
7bac77df7b
1 changed files with 4 additions and 1 deletions
|
|
@ -248,7 +248,10 @@ public string to_preview_text(string? text, TextFormat format) {
|
||||||
preview = Geary.HTML.html_to_text(text, false);
|
preview = Geary.HTML.html_to_text(text, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Geary.String.reduce_whitespace(preview);
|
// XXX really shouldn't have to call make_valid here but do so to
|
||||||
|
// avoid segfaults in the regex engine on invalid char data. See
|
||||||
|
// issue #186 for the proper fix.
|
||||||
|
return Geary.String.reduce_whitespace(preview.make_valid());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue