Fix NullPointerException bug when a book in inventory is empty