diff --git a/src/server/game/GameLogic.go b/src/server/game/GameLogic.go index d0bdf407..0f077a53 100644 --- a/src/server/game/GameLogic.go +++ b/src/server/game/GameLogic.go @@ -429,11 +429,13 @@ func (ad *GameLogic) GetResFriendPlayerByUid(Id int) *msg.ResFriendPlayerSimple return nil } } - LastActLog := player.ActLog - Last := &msg.ActLog{ - Type: int32(LastActLog.Type), - Time: LastActLog.Time, - Param: LastActLog.Param, + last := &msg.ActLog{} + if player.ActLog != nil { + last = &msg.ActLog{ + Type: int32(player.ActLog.Type), + Time: player.ActLog.Time, + Param: player.ActLog.Param, + } } return &msg.ResFriendPlayerSimple{ Uid: int64(player.Uid), @@ -450,7 +452,7 @@ func (ad *GameLogic) GetResFriendPlayerByUid(Id int) *msg.ResFriendPlayerSimple DressSet: GoUtil.MapIntToInt32(player.DressSet), Friend: GoUtil.IntToInt32(player.Friend), Physiology: GoUtil.MapIntToInt32(player.Physiology), - Last: Last, + Last: last, PetName: player.PetName, } }