From 48c342eb6fb2fb44d906411f73c8f02fb531ae38 Mon Sep 17 00:00:00 2001 From: Trym Hamer Gudvangen <trym.gudvangen@gmail.com> Date: Sun, 21 May 2023 21:37:30 +0200 Subject: [PATCH] feat: add setter for story title --- .../java/edu/ntnu/idatt2001/group_30/paths/model/Story.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Story.java b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Story.java index f4aca83..29c8a09 100644 --- a/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Story.java +++ b/src/main/java/edu/ntnu/idatt2001/group_30/paths/model/Story.java @@ -106,7 +106,7 @@ public class Story { * @param title The new title of the story, given as a {@code String}. */ public void setTitle(String title) { - if (title.isBlank()) throw new IllegalArgumentException( + if (title == null || title.isBlank()) throw new IllegalArgumentException( "Title cannot be blank, empty, or contain special characters." ); this.title = title; -- GitLab