diff --git a/rpdata/api/Chapter.js b/rpdata/api/Chapter.js index 09d7797..ef3e754 100644 --- a/rpdata/api/Chapter.js +++ b/rpdata/api/Chapter.js @@ -16,7 +16,7 @@ class Chapter { this.author = author this.source = source this.createdDate = new Date(createdDate) - this.fictionalDate = new Date(fictionalDate) + this.fictionalDate = fictionalDate != null ? new Date(fictionalDate) : null this.editedDate = new Date(editedDate) } diff --git a/rpdata/api/Story.js b/rpdata/api/Story.js index 36a0e77..15f7fa5 100644 --- a/rpdata/api/Story.js +++ b/rpdata/api/Story.js @@ -23,7 +23,7 @@ class Story { this.category = category this.createdDate = new Date(createdDate) this.updatedDate = new Date(updatedDate) - this.fictionalDate = new Date(fictionalDate) + this.fictionalDate = fictionalDate != null ? new Date(fictionalDate) : null this.tags = tags.map(dt => new Tag(dt.kind, dt.name)) this.chapters = chapters != null ? chapters.map(c => new Chapter(c.id, c.title, c.author, c.source, c.createdDate, c.fictionalDate, c.editedDate)) : null }