mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +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:
parent
d64561b0b1
commit
ed0d1978aa
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user