From e8c2cf28357dbff94293b8a9247ba6de084467b8 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Tue, 1 Aug 2023 11:03:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20room=20=E5=8C=85?= =?UTF-8?q?=E4=B8=AD=E9=80=9A=E8=BF=87=20Manager=20=E8=8E=B7=E5=8F=96=20He?= =?UTF-8?q?lper=20=E6=97=B6=EF=BC=8C=E5=BD=93=E4=BC=A0=E5=85=A5=E7=9A=84?= =?UTF-8?q?=20room=20=E4=B8=BA=E7=A9=BA=E4=BE=9D=E6=97=A7=E4=BC=9A?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E4=B8=8D=E4=B8=BA=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E7=9A=84=20Helper=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game/room/manager.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/game/room/manager.go b/game/room/manager.go index 4dbf46f..0f59582 100644 --- a/game/room/manager.go +++ b/game/room/manager.go @@ -32,6 +32,9 @@ type Manager[PID comparable, P game.Player[PID], R Room] struct { // GetHelper 获取房间助手 func (slf *Manager[PID, P, R]) GetHelper(room R) *Helper[PID, P, R] { + if generic.IsNil(room) { + return nil + } helper, exist := slf.helpers.GetExist(room.GetGuid()) if exist { return helper