Merge pull request #3299 from stojg/pull/if-user-logged-out-causes-500-error

BUG If user is logged out getHtmlEditorConfigForCMS() gets called on non object
This commit is contained in:
Mateusz U 2014-07-17 15:15:30 +12:00
commit 613722053c

View File

@ -267,8 +267,10 @@ class LeftAndMain extends Controller implements PermissionProvider {
if(empty($_REQUEST['executeForm']) && !$this->request->isAjax()) $this->extend('accessedCMS');
// Set the members html editor config
HtmlEditorConfig::set_active(Member::currentUser()->getHtmlEditorConfigForCMS());
if(Member::currentUser()) {
HtmlEditorConfig::set_active(Member::currentUser()->getHtmlEditorConfigForCMS());
}
// Set default values in the config if missing. These things can't be defined in the config
// file because insufficient information exists when that is being processed
$htmlEditorConfig = HtmlEditorConfig::get_active();