Skip to content

Commit

Permalink
BUG If user is logged out getHtmlEditorConfigForCMS() gets called on …
Browse files Browse the repository at this point in the history
…non object

This can happen if the auto-logout feature logs a user out and the user then tries to open another admin or
do an pjax call.
  • Loading branch information
Stig Lindqvist committed Jul 17, 2014
1 parent 830c107 commit ac64d25
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions admin/code/LeftAndMain.php
Expand Up @@ -267,8 +267,10 @@ public function init() {
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();
Expand Down

0 comments on commit ac64d25

Please sign in to comment.