0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 16:42:48 +01:00

fixed panic error on user login

This commit is contained in:
blemasle 2015-03-25 15:39:36 +01:00
parent c5c5aac7a5
commit e1a4f99eaa

View file

@ -5,6 +5,7 @@ import (
"fmt"
"io"
"reflect"
"errors"
)
type Packet struct {
@ -177,6 +178,10 @@ func readBytes(reader io.Reader, buf []byte) error {
idx := 0
buflen := len(buf)
if reader == nil {
return errors.New("reader was nil, aborting")
}
for idx < buflen {
n, err := reader.Read(buf[idx:])
if err != nil {