1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Merge pull request #1147 from blemasle/develop

fixed panic error on user login
This commit is contained in:
无闻 2015-03-25 12:23:54 -04:00
commit 5a5f072177

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 {