Skip to content

Commit

Permalink
Fix a few undefined records (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkfg authored Jul 18, 2024
1 parent eb626a7 commit 77cc936
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/resources/destinations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const DestinationTitle = () => {
const translate = useTranslate();
return (
<span>
{translate("resources.destinations.name", 1)} {record.destination}
{translate("resources.destinations.name", 1)} {record?.destination}
</span>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/resources/rooms.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const RoomTitle = () => {

const RoomShowActions = () => {
const record = useRecordContext();
const publishButton = record.public ? <RoomDirectoryUnpublishButton /> : <RoomDirectoryPublishButton />;
const publishButton = record?.public ? <RoomDirectoryUnpublishButton /> : <RoomDirectoryPublishButton />;
// FIXME: refresh after (un)publish
return (
<TopToolbar>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const UserEditActions = () => {

return (
<TopToolbar>
{!record.deactivated && <ServerNoticeButton />}
{!record?.deactivated && <ServerNoticeButton />}
<DeleteButton
label="resources.users.action.erase"
confirmTitle={translate("resources.users.helper.erase", {
Expand Down

0 comments on commit 77cc936

Please sign in to comment.