Conform more of the codebase to strictNullChecks (#10800)
This commit is contained in:
parent
adb29b38a3
commit
456c66db5b
46 changed files with 147 additions and 123 deletions
|
@ -19,7 +19,7 @@ import React, { ChangeEvent } from "react";
|
|||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { _t } from "../../../languageHandler";
|
||||
import { _t, UserFriendlyError } from "../../../languageHandler";
|
||||
import { ensureDMExists } from "../../../createRoom";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import SdkConfig from "../../../SdkConfig";
|
||||
|
@ -245,6 +245,10 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
|||
// Report to moderators through to the dedicated bot,
|
||||
// as configured in the room's state events.
|
||||
const dmRoomId = await ensureDMExists(client, this.moderation.moderationBotUserId);
|
||||
if (!dmRoomId) {
|
||||
throw new UserFriendlyError("Unable to create room with moderation bot");
|
||||
}
|
||||
|
||||
await client.sendEvent(dmRoomId, ABUSE_EVENT_TYPE, {
|
||||
event_id: ev.getId(),
|
||||
room_id: ev.getRoomId(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue