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:
Dylan K. Taylor 2020-06-01 12:46:41 +01:00
parent d64561b0b1
commit ed0d1978aa

View File

@ -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;
}