Skip to content

Commit 1ef0a65

Browse files
committed
Prevent error if using RichEditor on front-end
(in case it is ever possible)
1 parent c047707 commit 1ef0a65

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Plugin.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ public function boot()
6565
$widget->addJs('/plugins/rainlab/pages/assets/js/pages-snippets.js', 'RainLab.Pages');
6666

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

0 commit comments

Comments
 (0)