Skip to content

Commit

Permalink
Protect against possible null when getting book stack (#58)
Browse files Browse the repository at this point in the history
I'm not sure how this could happen, but yeah.
  • Loading branch information
TehNut committed Feb 11, 2017
1 parent b24281f commit 9faf89f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/amerifrance/guideapi/api/GuideAPI.java
Expand Up @@ -27,7 +27,7 @@ public class GuideAPI {
* @return - The ItemStack associated with the provided book.
*/
public static ItemStack getStackFromBook(Book book) {
return BOOK_TO_STACK.get(book);
return BOOK_TO_STACK.get(book) == null ? ItemStack.EMPTY : BOOK_TO_STACK.get(book);
}

/**
Expand Down

0 comments on commit 9faf89f

Please sign in to comment.