[Rt-commit] r18818 - rt/3.999/trunk/lib/RT/Model
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Tue Mar 17 02:25:09 EDT 2009
Author: sunnavy
Date: Tue Mar 17 02:25:08 2009
New Revision: 18818
Modified:
rt/3.999/trunk/lib/RT/Model/Ticket.pm
Log:
some role_group maybe not exist
Modified: rt/3.999/trunk/lib/RT/Model/Ticket.pm
==============================================================================
--- rt/3.999/trunk/lib/RT/Model/Ticket.pm (original)
+++ rt/3.999/trunk/lib/RT/Model/Ticket.pm Tue Mar 17 02:25:08 2009
@@ -1745,16 +1745,19 @@
#add all of this ticket's watchers to that ticket.
foreach my $watcher_type ( $self->roles ) {
- my $people = $self->role_group($watcher_type)->members;
-
- while ( my $watcher = $people->next ) {
-
- my ( $val, $msg ) = $MergeInto->_add_watcher(
- type => $watcher_type,
- silent => 1,
- principal_id => $watcher->member_id
- );
- Jifty->log->warn($msg) unless ($val);
+ my $group = $self->role_group($watcher_type);
+ if ( $group->id ) {
+ my $people = $group->members;
+
+ while ( my $watcher = $people->next ) {
+
+ my ( $val, $msg ) = $MergeInto->_add_watcher(
+ type => $watcher_type,
+ silent => 1,
+ principal_id => $watcher->member_id
+ );
+ Jifty->log->warn($msg) unless ($val);
+ }
}
}
More information about the Rt-commit
mailing list