check empty

pull/1524/head^2
Darien Raymond 2018-07-29 15:10:06 +02:00
parent 47f1399995
commit 3b0bfe9422
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 3 additions and 0 deletions

View File

@ -205,6 +205,9 @@ func (w *ReceivingWorker) ReadMultiBuffer() buf.MultiBuffer {
func (w *ReceivingWorker) Read(b []byte) int {
mb := w.ReadMultiBuffer()
if mb.IsEmpty() {
return 0
}
nBytes, err := mb.Read(b)
common.Must(err)
if !mb.IsEmpty() {