kareila: (Default)
kareila ([personal profile] kareila) wrote in [site community profile] changelog2011-01-17 02:45 am

[dw-free] xposter needs to check if entry still exists before trying to xpost it

[commit: http://hg.dwscoalition.org/dw-free/rev/daca6070e1a4]

http://bugs.dwscoalition.org/show_bug.cgi?id=3370

Detect and abort attempts to crosspost invalid entries.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/DW/Worker/XPostWorker.pm
--------------------------------------------------------------------------------
diff -r 64dbecb7fe3f -r daca6070e1a4 cgi-bin/DW/Worker/XPostWorker.pm
--- a/cgi-bin/DW/Worker/XPostWorker.pm	Sun Jan 16 20:14:09 2011 -0600
+++ b/cgi-bin/DW/Worker/XPostWorker.pm	Sun Jan 16 20:45:02 2011 -0600
@@ -66,7 +66,7 @@ sub work {
     return $job->failed("Unable to load account $acctid for uid $uid") unless defined $acct;
 
     my $entry = LJ::Entry->new($u, ditemid => $ditemid);
-    return $job->failed("Unable to load entry $ditemid for uid $uid") unless defined $entry;
+    return $job->failed("Unable to load entry $ditemid for uid $uid") unless defined $entry && $entry->valid;
 
     my %auth;
     if ($auth_response) {
--------------------------------------------------------------------------------