mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-28 12:46:09 +01:00
Merge pull request #1147 from blemasle/develop
fixed panic error on user login
This commit is contained in:
commit
5a5f072177
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Packet struct {
|
type Packet struct {
|
||||||
|
@ -177,6 +178,10 @@ func readBytes(reader io.Reader, buf []byte) error {
|
||||||
idx := 0
|
idx := 0
|
||||||
buflen := len(buf)
|
buflen := len(buf)
|
||||||
|
|
||||||
|
if reader == nil {
|
||||||
|
return errors.New("reader was nil, aborting")
|
||||||
|
}
|
||||||
|
|
||||||
for idx < buflen {
|
for idx < buflen {
|
||||||
n, err := reader.Read(buf[idx:])
|
n, err := reader.Read(buf[idx:])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue