From fd2343dd28bb72b95c1dd32ecefb80d24ddc02ef Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 4 Dec 2019 19:25:59 -0700 Subject: [PATCH] Add some null safety to ban lists --- src/models/BanList.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/models/BanList.ts b/src/models/BanList.ts index cc72ea6d..56fa39b8 100644 --- a/src/models/BanList.ts +++ b/src/models/BanList.ts @@ -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'] || ''; - if (!entity || !recommendation || !reason) { + if (!entity || !recommendation) { continue; }