code: protected function getNextPage($rootPageId)
  	{
  		$objNextPage = PageModel::findFirstPublishedByPid($rootPageId);
  
  		// No published pages yet
  		if (null === $objNextPage)
  		{
  			$this->log('No active page found under root page "' . $rootPageId . '")', __METHOD__, TL_ERROR);
  			throw new NoActivePageFoundException('No active page found under root page.');
  		}
  
  		return $objNextPage;
  	}
docs: Prepare the page object and redirect URL
  
  @param integer $rootPageId
  
  @return PageModel
  
  @throws NoActivePageFoundException