         }
         searchBar.apply(theme: theme)
         searchBarContainerView.backgroundColor = theme.colors.paperBackground
-        searchLanguageBarViewController.apply(theme: theme)
+        searchLanguageBarViewController?.apply(theme: theme)
         resultsViewController.apply(theme: theme)
         view.backgroundColor = .clear
         collectionView.backgroundColor = theme.colors.paperBackground

        }
    }
    
    private func updateLanguageBarVisibility() {
        if UserDefaults.wmf_userDefaults().wmf_showSearchLanguageBar() { // check this before accessing the view
            navigationBar.addExtendedNavigationBarView(searchLanguageBarViewController.view)
            searchLanguageBarViewController.view.isHidden = false
        } else {
            navigationBar.removeExtendedNavigationBarView()
            searchLanguageBarViewController.view.isHidden = true
        }
    }


    }
    
    var siteURL: URL? {
        return searchLanguageBarViewController?.currentlySelectedSearchLanguage?.siteURL() ?? NSURL.wmf_URLWithDefaultSiteAndCurrentLocale()
    }
    
    @objc func search() {
