diff --git a/src/main/java/org/ntlab/citrusserver/repositories/BookManager.java b/src/main/java/org/ntlab/citrusserver/repositories/BookManager.java index 779fa8b..122e63a 100644 --- a/src/main/java/org/ntlab/citrusserver/repositories/BookManager.java +++ b/src/main/java/org/ntlab/citrusserver/repositories/BookManager.java @@ -26,6 +26,9 @@ //本の新規作成 public int createBook(String accountId, String title, String color, Boolean publicity) { + if(!booksMap.containsKey(accountId)){ + booksMap.put(accountId, new HashMap<>()); + } Account account = accountManager.getAccount(accountId); //アカウントの取得 int newBookId = account.getNewBookId(); //新たに生成されたIdを取得(作成数もここで加算している) Book book = new Book(newBookId, title, publicity, color); //本の初期化