Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: update use info is empty

shuaidf79e4b8a031
diff --git a/ui/src/pages/Questions/Detail/components/Answer/index.tsx b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
index d1b76be7..d35669ff 100644
--- a/ui/src/pages/Questions/Detail/components/Answer/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
@@ -118,7 +118,8 @@ const Index: FC<Props> = ({
/>
</Col>
<Col lg={3} className="mb-3 mb-md-0">
- {data.update_user_info?.username !== data.user_info?.username ? (
+ {data.update_user_info &&
+ data.update_user_info?.username !== data.user_info?.username ? (
<UserCard
data={data?.update_user_info}
time={Number(data.update_time)}
diff --git a/ui/src/pages/Questions/Detail/components/Question/index.tsx b/ui/src/pages/Questions/Detail/components/Question/index.tsx
index 04ef1a0f..80eca32c 100644
--- a/ui/src/pages/Questions/Detail/components/Question/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Question/index.tsx
@@ -130,7 +130,8 @@ const Index: FC<Props> = ({ data, initPage, hasAnswer, isLogged }) => {
/>
</Col>
<Col lg={3} className="mb-3 mb-md-0">
- {data.update_user_info?.username !== data.user_info?.username ? (
+ {data.update_user_info &&
+ data.update_user_info?.username !== data.user_info?.username ? (
<UserCard
data={data?.update_user_info}
time={data.edit_time}