Fixes an exception when trying to load an empty book list
This commit is contained in:
@@ -139,7 +139,12 @@ public class BooksWithoutBorders extends JavaPlugin {
|
||||
getInstance().playerLetterIndex.put(playerUUID, BookFileHelper.populateLetterIndices(newFiles));
|
||||
}
|
||||
}
|
||||
return new ArrayList<>(getInstance().playerBooksList.get(playerUUID));
|
||||
List<String> books = getInstance().playerBooksList.get(playerUUID);
|
||||
if (books != null) {
|
||||
return new ArrayList<>(books);
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
Reference in New Issue
Block a user