findDefault() public method

If the defaultSiteNodeName-setting is null the first active site is returned If the site is not found or not active an exception is thrown
public findDefault ( ) : Site
return Neos\Neos\Domain\Model\Site
 /**
  * Determines the current domain and site from the request and sets the resulting values as
  * as defaults.
  *
  * @param array $defaultContextProperties
  * @return array
  */
 protected function setDefaultSiteAndDomainFromCurrentRequest(array $defaultContextProperties)
 {
     $currentDomain = $this->domainRepository->findOneByActiveRequest();
     if ($currentDomain !== null) {
         $defaultContextProperties['currentSite'] = $currentDomain->getSite();
         $defaultContextProperties['currentDomain'] = $currentDomain;
     } else {
         $defaultContextProperties['currentSite'] = $this->siteRepository->findDefault();
     }
     return $defaultContextProperties;
 }
 /**
  * Default action, displays the login screen
  *
  * @param string $username Optional: A username to pre-fill into the username field
  * @param boolean $unauthorized
  * @return void
  */
 public function indexAction($username = null, $unauthorized = false)
 {
     if ($this->securityContext->getInterceptedRequest() || $unauthorized) {
         $this->response->setStatus(401);
     }
     if ($this->authenticationManager->isAuthenticated()) {
         $this->redirect('index', 'Backend\\Backend');
     }
     $currentDomain = $this->domainRepository->findOneByActiveRequest();
     $currentSite = $currentDomain !== null ? $currentDomain->getSite() : $this->siteRepository->findDefault();
     $this->view->assignMultiple(['styles' => array_filter($this->settings['userInterface']['backendLoginForm']['stylesheets']), 'username' => $username, 'site' => $currentSite]);
 }