From a73f3b1c2a3f9d0c95afc739b8fdd2b266844a63 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Thu, 22 Oct 2026 14:13:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(chat):=20=E9=81=BF=E5=85=8D=E7=BE=A4?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=9F=A5=E4=B8=8D=E5=88=B0=E6=97=B6=E5=AF=B9?= =?UTF-8?q?=20null=20=E5=8F=96=E4=B8=8B=E6=A0=87=EF=BC=88PHP=207.4=20?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit processMessage 中 room_id 未在 Rooms/qiweRooms 表中登记时,find() 返回 null,PHP 7.4 起取 ['type'] 会抛 Trying to access array offset on value of type null。改用 ?? 取默认 null,行为与升级前一致:落 switch default 返回"群聊类型未命中"。 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- application/index/controller/wms/Chat.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/index/controller/wms/Chat.php b/application/index/controller/wms/Chat.php index a422512..d83e9eb 100644 --- a/application/index/controller/wms/Chat.php +++ b/application/index/controller/wms/Chat.php @@ -525,11 +525,11 @@ class Chat extends Frontend switch($this->SOURCE){ case "wx": $roominfo = $this->RoomsModel->where(["room_id"=>$fromid])->find(); - $roomtype = $roominfo['type']; + $roomtype = $roominfo['type'] ?? null; break; case "qiwe": $roominfo = $this->qiweRoomsModel->where(["room_id"=>$fromid])->find(); - $roomtype = $roominfo['type']; + $roomtype = $roominfo['type'] ?? null; Log::error("企微的查找群信息".json_encode($roominfo)); break; default: