Add safety around missing topics and space settings (#8957)
This commit is contained in:
parent
3329b35bd0
commit
924865b315
2 changed files with 3 additions and 2 deletions
|
@ -48,7 +48,7 @@ const SpaceSettingsGeneralTab = ({ matrixClient: cli, space, onFinished }: IProp
|
|||
const canSetName = space.currentState.maySendStateEvent(EventType.RoomName, userId);
|
||||
const nameChanged = name !== space.name;
|
||||
|
||||
const currentTopic = getTopic(space).text;
|
||||
const currentTopic = getTopic(space)?.text;
|
||||
const [topic, setTopic] = useState<string>(currentTopic);
|
||||
const canSetTopic = space.currentState.maySendStateEvent(EventType.RoomTopic, userId);
|
||||
const topicChanged = topic !== currentTopic;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue