1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-06-28 10:55:27 +02:00

add null check to OrganizationInvite init methods

This commit is contained in:
Jake Fink 2024-06-18 09:39:31 -04:00
parent 18706c7f11
commit 8d370acafb
No known key found for this signature in database
GPG Key ID: FD482F8453480035

View File

@ -12,10 +12,18 @@ export class OrganizationInvite {
token: string;
static fromJSON(json: Jsonify<OrganizationInvite>) {
if (json == null) {
return null;
}
return Object.assign(new OrganizationInvite(), json);
}
static fromParams(params: Params): OrganizationInvite {
if (params == null) {
return null;
}
return Object.assign(new OrganizationInvite(), {
email: params.email,
initOrganization: params.initOrganization?.toLocaleLowerCase() === "true",