[geary/mjog/692-dont-serialise-empty-array] Geary.Imap.Serializer: Don't try to serialise empty literal data
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/692-dont-serialise-empty-array] Geary.Imap.Serializer: Don't try to serialise empty literal data
- Date: Fri, 20 Mar 2020 09:09:32 +0000 (UTC)
commit 97530fac96a96fc320ce7ed9843c48b2d3e80aa2
Author: Michael Gratton <mike vee net>
Date: Fri Mar 20 20:07:29 2020 +1100
Geary.Imap.Serializer: Don't try to serialise empty literal data
Fixes #692
src/engine/imap/transport/imap-serializer.vala | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/engine/imap/transport/imap-serializer.vala b/src/engine/imap/transport/imap-serializer.vala
index 36dafca9..549391fc 100644
--- a/src/engine/imap/transport/imap-serializer.vala
+++ b/src/engine/imap/transport/imap-serializer.vala
@@ -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
+ );
+ }
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]