From 5bfdae58ed9bcc7f039b664122fecc6d0ace670d Mon Sep 17 00:00:00 2001 From: Daniel Morgenstern Date: Wed, 12 Sep 2018 09:10:37 +0200 Subject: [PATCH] fix #27: initialize crafter.email correctly --- types/Crafter.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/Crafter.ts b/types/Crafter.ts index d2b083f..becbd42 100644 --- a/types/Crafter.ts +++ b/types/Crafter.ts @@ -29,7 +29,7 @@ export default class Crafter extends Searchable { }); private static allCrafters: Crafter[] = []; - public readonly name?: string; + public readonly name: string; public readonly email?: string; public readonly url?: string; @@ -64,7 +64,11 @@ export default class Crafter extends Searchable { } } else { this.name = author.name; + this.email = author.email; + this.url = author.url; } + } else { + this.name = 'Unknown'; } const alreadyCreatedCrafter = Crafter.allCrafters.find((crafter) => crafter.equals(this),