mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-10-01 01:36:06 -04:00
Add some null safety to ban lists
This commit is contained in:
parent
0879cd58a0
commit
fd2343dd28
@ -43,7 +43,7 @@ export default class BanList {
|
||||
}
|
||||
|
||||
public get listShortcode(): string {
|
||||
return this.shortcode;
|
||||
return this.shortcode || '';
|
||||
}
|
||||
|
||||
public set listShortcode(newShortcode: string) {
|
||||
@ -98,9 +98,9 @@ export default class BanList {
|
||||
|
||||
const entity = content['entity'];
|
||||
const recommendation = content['recommendation'];
|
||||
const reason = content['reason'];
|
||||
const reason = content['reason'] || '<no reason>';
|
||||
|
||||
if (!entity || !recommendation || !reason) {
|
||||
if (!entity || !recommendation) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user