fix nil savedata error proper

This commit is contained in:
wish
2023-02-12 01:35:48 +11:00
parent e9d57b477f
commit 174f58c014
3 changed files with 4 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package channelserver
import (
"encoding/binary"
"errors"
"erupe-ce/common/bfutil"
"erupe-ce/common/stringsupport"
@@ -58,6 +59,7 @@ func GetCharacterSaveData(s *Session, charID uint32) (*CharacterSaveData, error)
}
defer result.Close()
if !result.Next() {
err = errors.New("no savedata found")
s.logger.Error("No savedata found", zap.Uint32("charID", charID))
return nil, err
}