From f9a4a028eb317fbe44128ebb2494e002f64f6358 Mon Sep 17 00:00:00 2001 From: hamed <15238-genius.ha@users.noreply.drupalcode.org> Date: Mon, 15 Jun 2026 00:52:32 +0330 Subject: [PATCH] fix(doctor): guard optional chaining on address array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit برخی پزشکان address ندارند؛ data?.address[0] روی آن‌ها کرش می‌کرد (Cannot read properties of undefined). اصلاح به data?.address?.[0] در Address و Telefon صفحه پروفایل پزشک. Co-Authored-By: Claude Opus 4.8 --- components/doctor/poster/Address.js | 2 +- components/doctor/poster/Telefon.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/doctor/poster/Address.js b/components/doctor/poster/Address.js index d0d53df..c064278 100644 --- a/components/doctor/poster/Address.js +++ b/components/doctor/poster/Address.js @@ -8,7 +8,7 @@ function Address({ data }) {

آدرس:

- {data?.address[0]?.address} + {data?.address?.[0]?.address}

); diff --git a/components/doctor/poster/Telefon.js b/components/doctor/poster/Telefon.js index 0fb2a56..6d38e4c 100644 --- a/components/doctor/poster/Telefon.js +++ b/components/doctor/poster/Telefon.js @@ -3,14 +3,14 @@ import TelefonPoster from "@/components/icons/TelefonPoster"; function Telefon({ data }) { return (

تلفن:

- {data?.address[0]?.phone} + {data?.address?.[0]?.phone}

{data?.address && data?.address.length > 1 &&