From e8e3ca29e250f38be86e7c97f0bf03cec5374693 Mon Sep 17 00:00:00 2001 From: Xor Boole Date: Sun, 28 Dec 2014 13:57:27 -0400 Subject: [PATCH] Add null check before iterating over iterator. --- .../org/bukkit/craftbukkit/inventory/CraftMetaBook.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java index a76ae7d715..42ecde7ee9 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -99,9 +99,11 @@ class CraftMetaBook extends CraftMetaItem implements BookMeta { setTitle(SerializableMeta.getString(map, BOOK_TITLE.BUKKIT, true)); Iterable pages = SerializableMeta.getObject(Iterable.class, map, BOOK_PAGES.BUKKIT, true); - for (Object page : pages) { - if (page instanceof String) { - addPage((String) page); + if(pages != null) { + for (Object page : pages) { + if (page instanceof String) { + addPage((String) page); + } } }