Conform more of the codebase to strictNullChecks + noImplicitAny (#11179)

This commit is contained in:
Michael Telatynski 2023-07-04 14:49:27 +01:00 committed by GitHub
parent 7c211b0587
commit a294ba2ad4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 104 additions and 88 deletions

View file

@ -25,7 +25,7 @@ import { RoomPreviewOpts, RoomViewLifecycle } from "@matrix-org/react-sdk-module
import { MatrixClientPeg } from "../../../MatrixClientPeg";
import dis from "../../../dispatcher/dispatcher";
import { _t } from "../../../languageHandler";
import { _t, UserFriendlyError } from "../../../languageHandler";
import SdkConfig from "../../../SdkConfig";
import IdentityAuthClient from "../../../IdentityAuthClient";
import InviteReason from "../elements/InviteReason";
@ -153,6 +153,9 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
this.props.invitedEmail,
identityAccessToken!,
);
if (!("mxid" in result)) {
throw new UserFriendlyError("Unable to find user by email");
}
this.setState({ invitedEmailMxid: result.mxid });
} catch (err) {
this.setState({ threePidFetchError: err as MatrixError });