mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 04:09:54 +01:00
Add null check before iterating over iterator.
This commit is contained in:
parent
eae50b4f2a
commit
e8e3ca29e2
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user