Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r16149: LJSV-878 (ESN refactoring, part 1): do n...

Committer: ailyin
LJSV-878 (ESN refactoring, part 1): do not put undefs into @subs and do
not try to parse them

U   trunk/cgi-bin/LJ/ESN.pm
U   trunk/cgi-bin/LJ/Event/JournalNewComment.pm
Modified: trunk/cgi-bin/LJ/ESN.pm
===================================================================
--- trunk/cgi-bin/LJ/ESN.pm	2010-01-27 09:47:35 UTC (rev 16148)
+++ trunk/cgi-bin/LJ/ESN.pm	2010-01-27 09:56:13 UTC (rev 16149)
@@ -47,6 +47,7 @@
     }
 
     @subs = grep {
+        defined $_ &&
         $evt->available_for_user($_->owner) &&
         $evt->matches_filter($_);
     } @subs;

Modified: trunk/cgi-bin/LJ/Event/JournalNewComment.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2010-01-27 09:47:35 UTC (rev 16148)
+++ trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2010-01-27 09:56:13 UTC (rev 16149)
@@ -706,7 +706,8 @@
             'ntypeid' => $email_ntypeid,
         }) if $parent_comment_author->{'opt_gettalkemail'} eq 'Y';
 
-        if (my $count = $acquire_sub_slot->(scalar(@subs2))) {
+        my $count = scalar(@subs2);
+        if ($count && ($count = $acquire_sub_slot->($count))) {
             $#subs2 = $count - 1;
             push @subs, @subs2;
         }
@@ -739,10 +740,10 @@
 
     return @subs unless ($limit || !$original_limit);
 
-    push @subs, eval { $self->SUPER::subscriptions(
+    push @subs, $self->SUPER::subscriptions(
         cluster => $cid,
         limit   => $limit
-    ) };
+    );
 
     return @subs;
 }

Tags: andy, livejournal, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments