Merge branch 'mjog/692-dont-serialise-empty-array' into 'mainline'

Geary.Imap.Serializer: Don't try to serialise empty literal data

Closes #692

See merge request GNOME/geary!453
This commit is contained in:
Michael Gratton 2020-03-23 10:31:54 +00:00
commit 8f4e573ef6

View file

@ -106,12 +106,14 @@ public class Geary.Imap.Serializer : BaseObject {
public async void push_literal_data(uint8[] buffer,
GLib.Cancellable? cancellable = null)
throws GLib.Error {
yield this.output.write_all_async(
buffer,
Priority.DEFAULT,
cancellable,
null
);
if (buffer.length > 0) {
yield this.output.write_all_async(
buffer,
Priority.DEFAULT,
cancellable,
null
);
}
}
/**