File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -138,8 +138,10 @@ public function register()
138
138
$ parentEntity = EntitiesFactory::build ($ entity ->getAccessId ());
139
139
$ user = $ params ['user ' ];
140
140
141
- $ canRead = ACL ::_ ()->read ($ parentEntity , $ user );
142
- $ event ->setResponse ($ canRead );
141
+ if ($ parentEntity ) {
142
+ $ canRead = ACL ::_ ()->read ($ parentEntity , $ user );
143
+ $ event ->setResponse ($ canRead );
144
+ }
143
145
});
144
146
145
147
// If comment is container_guid then decide if we can allow writing
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ class Flags
8
8
{
9
9
public static function shouldFail ($ entity )
10
10
{
11
+ if (!$ entity ) {
12
+ return false ;
13
+ }
14
+
11
15
$ currentUser = Core \Session::getLoggedInUserGuid ();
12
16
$ owner = $ entity instanceof User ? $ entity ->guid : $ entity ->getOwnerGuid ();
13
17
You can’t perform that action at this time.
0 commit comments