Skip to content

Commit

Permalink
Prevent error if using RichEditor on front-end
Browse files Browse the repository at this point in the history
(in case it is ever possible)
  • Loading branch information
Fl0Cri committed Mar 22, 2023
1 parent c047707 commit 1ef0a65
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public function boot()
$widget->addJs('/plugins/rainlab/pages/assets/js/pages-snippets.js', 'RainLab.Pages');

// Adds custom assets
$user = BackendAuth::getUser();
if ($user->hasAccess('rainlab.pages.access_snippets')) {
if (optional(BackendAuth::getUser())->hasAccess('rainlab.pages.access_snippets')) {
$widget->addJs('/inetis/snippets/list');
$widget->addJs('/plugins/inetis/richeditorsnippets/assets/js/froala.snippets.plugin.js', 'Inetis.RicheditorSnippets');
$widget->addCss('/plugins/inetis/richeditorsnippets/assets/css/richeditorsnippets.css', 'Inetis.RicheditorSnippets');
Expand Down

0 comments on commit 1ef0a65

Please sign in to comment.