<commit_before><?php
namespace wcf\system\box;
use wcf\data\article\category\ArticleCategoryNodeTree;
use wcf\page\ArticlePage;
use wcf\page\CategoryArticleListPage;
use wcf\system\request\RequestHandler;
use wcf\system\WCF;

/**
 * Box for article categories.
 *
 * @author	<NAME>
 * @copyright	2001-2016 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Box
 * @since	3.0
 */
class ArticleCategoriesBoxController extends AbstractBoxController {
	/**
	 * @inheritDoc
	 */
	protected static $supportedPositions = ['footerBoxes', 'sidebarLeft', 'sidebarRight', 'contentTop', 'contentBottom', 'footer'];
	
	/**
	 * @inheritDoc
	 */
	protected function loadContent() {
		// get categories
		$categoryTree = new ArticleCategoryNodeTree('com.woltlab.wcf.article.category');
		$categoryList = $categoryTree->getIterator();
		$categoryList->setMaxDepth(0);
		
		if (iterator_count($categoryList)) {
			// get active category
			$activeCategory = null;
			if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof CategoryArticleListPage || RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof ArticlePage) {
				if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category !== null) {
					$activeCategory = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category;
				}
			}
			
			$this->content = WCF::getTPL()->fetch('boxArticleCategories', 'wcf', ['categoryList' => $categoryList, 'activeCategory' => $activeCategory]);
		}
	}
}<commit_msg>Fixed fatal error in box controllers if request object is undefined<commit_after><?php
namespace wcf\system\box;
use wcf\data\article\category\ArticleCategoryNodeTree;
use wcf\page\ArticlePage;
use wcf\page\CategoryArticleListPage;
use wcf\system\request\RequestHandler;
use wcf\system\WCF;

/**
 * Box for article categories.
 *
 * @author	<NAME>
 * @copyright	2001-2016 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 * @package	WoltLabSuite\Core\System\Box
 * @since	3.0
 */
class ArticleCategoriesBoxController extends AbstractBoxController {
	/**
	 * @inheritDoc
	 */
	protected static $supportedPositions = ['footerBoxes', 'sidebarLeft', 'sidebarRight', 'contentTop', 'contentBottom', 'footer'];
	
	/**
	 * @inheritDoc
	 */
	protected function loadContent() {
		// get categories
		$categoryTree = new ArticleCategoryNodeTree('com.woltlab.wcf.article.category');
		$categoryList = $categoryTree->getIterator();
		$categoryList->setMaxDepth(0);
		
		if (iterator_count($categoryList)) {
			// get active category
			$activeCategory = null;
			if (RequestHandler::getInstance()->getActiveRequest() !== null) {
				if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof CategoryArticleListPage || RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof ArticlePage) {
					if (RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category !== null) {
						$activeCategory = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->category;
					}
				}
			}
			
			$this->content = WCF::getTPL()->fetch('boxArticleCategories', 'wcf', ['categoryList' => $categoryList, 'activeCategory' => $activeCategory]);
		}
	}
}
{'fraction_non_alphanumeric': 0.14654919236417033, 'fraction_numerical': 0.0064610866372980915, 'mean_word_length': 5.462998102466793, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5328514', 'n_tokens_mistral': 1065, 'n_tokens_neox': 943, 'n_words': 185}