mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +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{
|
public function getPageText(int $pageId) : ?string{
|
||||||
$pages = $this->getNamedTag()->getListTag(self::TAG_PAGES);
|
$pages = $this->getNamedTag()->getListTag(self::TAG_PAGES);
|
||||||
if($pages === null){
|
if($pages === null or !$pages->isset($pageId)){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user