Fixes crasher when parsing an email address in an ISO encoding: #3790
GMime needs to be initialized prior to use. It looks like it builds some internal caches for encoding/decoding, leading to a null pointer fault when not initialized.
This commit is contained in:
parent
0273b78005
commit
009a061a16
1 changed files with 8 additions and 0 deletions
|
|
@ -5,7 +5,15 @@
|
|||
*/
|
||||
|
||||
public class Geary.Engine {
|
||||
private static bool gmime_inited = false;
|
||||
|
||||
public static Geary.EngineAccount open(Geary.Credentials cred) throws Error {
|
||||
// Initialize GMime
|
||||
if (!gmime_inited) {
|
||||
GMime.init(0);
|
||||
gmime_inited = true;
|
||||
}
|
||||
|
||||
// Only Gmail today
|
||||
return new GenericImapAccount(
|
||||
"Gmail account %s".printf(cred.to_string()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue