mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-29 19:51:30 +01:00
Merge pull request #75 in SPIGOT/craftbukkit from ~XOR/craftbukkit:fixbookserial to master
* commit 'e8e3ca29e250f38be86e7c97f0bf03cec5374693': Add null check before iterating over iterator.
This commit is contained in:
commit
08996835da
@ -99,11 +99,13 @@ class CraftMetaBook extends CraftMetaItem implements BookMeta {
|
|||||||
setTitle(SerializableMeta.getString(map, BOOK_TITLE.BUKKIT, true));
|
setTitle(SerializableMeta.getString(map, BOOK_TITLE.BUKKIT, true));
|
||||||
|
|
||||||
Iterable<?> pages = SerializableMeta.getObject(Iterable.class, map, BOOK_PAGES.BUKKIT, true);
|
Iterable<?> pages = SerializableMeta.getObject(Iterable.class, map, BOOK_PAGES.BUKKIT, true);
|
||||||
|
if(pages != null) {
|
||||||
for (Object page : pages) {
|
for (Object page : pages) {
|
||||||
if (page instanceof String) {
|
if (page instanceof String) {
|
||||||
addPage((String) page);
|
addPage((String) page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
generation = SerializableMeta.getObject(Integer.class, map, GENERATION.BUKKIT, true);
|
generation = SerializableMeta.getObject(Integer.class, map, GENERATION.BUKKIT, true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user