Add some null safety to ban lists

This commit is contained in:
Travis Ralston 2019-12-04 19:25:59 -07:00
parent 0879cd58a0
commit fd2343dd28

View File

@ -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;
}