[Rt-commit] rt branch, 4.6/membersobj-check-for-group, created. rt-4.4.4-540-g7a9ad58b3c
Craig Kaiser
craig at bestpractical.com
Tue Nov 26 16:57:43 EST 2019
The branch, 4.6/membersobj-check-for-group has been created
at 7a9ad58b3c29239d520467888aadd06db26f3965 (commit)
- Log -----------------------------------------------------------------
commit 7a9ad58b3c29239d520467888aadd06db26f3965
Author: Craig Kaiser <craig at bestpractical.com>
Date: Tue Nov 26 16:56:38 2019 -0500
Check that group object is defined before trying to limit
If RT::Group object is unloaded then the limit call for MembersObj will
result in a sql error.
diff --git a/lib/RT/Group.pm b/lib/RT/Group.pm
index 5dfc3fe7af..49949a1475 100644
--- a/lib/RT/Group.pm
+++ b/lib/RT/Group.pm
@@ -755,12 +755,17 @@ sub MembersObj {
my $self = shift;
my $members_obj = RT::GroupMembers->new( $self->CurrentUser );
- #If we don't have rights, don't include any results
- # TODO XXX WHY IS THERE NO ACL CHECK HERE?
- $members_obj->LimitToMembersOfGroup( $self->PrincipalId );
-
- return ( $members_obj );
+ if ( $self->PrincipalId ) {
+ #If we don't have rights, don't include any results
+ # TODO XXX WHY IS THERE NO ACL CHECK HERE?
+ $members_obj->LimitToMembersOfGroup( $self->PrincipalId );
+ return ( $members_obj );
+ }
+ else {
+ RT::Logger->error( "Can't call MembersObj on unloaded group, returning undef." );
+ return undef;
+ }
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list