mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
WritableBook: fixed thrown exception when asking for a page that doesn't exist (it's allowed to return null for a reason ...)
This commit is contained in:
@ -50,7 +50,7 @@ class WritableBook extends Item{
|
||||
*/
|
||||
public function getPageText(int $pageId) : ?string{
|
||||
$pages = $this->getNamedTag()->getListTag(self::TAG_PAGES);
|
||||
if($pages === null){
|
||||
if($pages === null or !$pages->isset($pageId)){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user