Add null check before iterating over iterator.

By: Xor Boole <mcyoung@mit.edu>
This commit is contained in:
CraftBukkit/Spigot 2014-12-28 13:57:27 -04:00
parent 4335c4162c
commit b29ae84fef

View file

@ -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);
}
}
}