Fixed sql exception
authorMarcel Werk <burntime@woltlab.com>
Mon, 28 Oct 2019 10:52:48 +0000 (11:52 +0100)
committerMarcel Werk <burntime@woltlab.com>
Mon, 28 Oct 2019 10:52:48 +0000 (11:52 +0100)
wcfsetup/install/files/lib/page/TrophyListPage.class.php

index 4c61154317239948cbfa5fb461076eb94d64c71f..fc16fa6deefee3e5bbc18ac027c068cd66f24c5e 100644 (file)
@@ -3,6 +3,7 @@ namespace wcf\page;
 use wcf\data\trophy\category\TrophyCategory;
 use wcf\data\trophy\category\TrophyCategoryCache;
 use wcf\data\trophy\TrophyList;
+use wcf\system\exception\IllegalLinkException;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
@@ -70,6 +71,10 @@ class TrophyListPage extends MultipleLinkPage {
                parent::readParameters();
                
                $this->canonicalURL = LinkHandler::getInstance()->getLink('TrophyList', [], ($this->pageNo > 1 ? 'pageNo=' . $this->pageNo : ''));
+               
+               if (!count(TrophyCategoryCache::getInstance()->getEnabledCategories())) {
+                       throw new IllegalLinkException();
+               }
        }
        
        /**