web/admin: fix error when copying token while none exist

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-15 23:25:06 +02:00
parent 2cde40aeee
commit ea2dbb2f33
1 changed files with 2 additions and 2 deletions

View File

@ -29,8 +29,8 @@ export class TokenCopyButton extends ActionButton {
this.buttonClass = PRIMARY_CLASS;
}, 1500);
});
}).catch((err: Response) => {
return err.json().then(errResp => {
}).catch((err: Response | undefined) => {
return err?.json().then(errResp => {
throw new Error(errResp["detail"]);
});
});