Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r20430: LJSV-1734: Error with exporting journal ...

Committer: gariev
LJSV-1734: Error with exporting journal via XML on external services.
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2011-10-25 14:21:56 UTC (rev 20429)
+++ trunk/cgi-bin/ljprotocol.pl	2011-10-25 14:24:29 UTC (rev 20430)
@@ -4306,7 +4306,13 @@
     
          $sth->execute($ownerid, $date);
          while (my ($id, $prop, $dt) = $sth->fetchrow_array) {
-         my $entry = LJ::Entry->new($ownerid, jitemid => $id);
+            my $entry = LJ::Entry->new($ownerid, jitemid => $id);
+
+            ## sometimes there is no row in log2 table, while there are rows in logprop2
+            ## it's either corrupted db (replication/failover problem) or lazy/slow deletion of an entry
+            ## calling $entry->anum on such an entry is a fatal error
+            next unless $entry && $entry->valid;
+
             if ($prop == $p_calter->{'id'}) {
                 $cmt{$id} = [ 'C', $id, $dt, "update", $entry->anum ];
             } elsif ($prop == $p_revtime->{'id'}) {

Tags: gariev, livejournal, pl
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 

  • 1 comment