wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r7529: LJSUP-4656.

Committer: wisest-owl
LJSUP-4656.
Fix bug with "Can't call method "sponsor" on an undefined value"


U   trunk/cgi-bin/LJ/SUP.pm
U   trunk/cgi-bin/LJ/Sponsored/User.pm
Modified: trunk/cgi-bin/LJ/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/SUP.pm	2009-08-03 06:20:00 UTC (rev 7528)
+++ trunk/cgi-bin/LJ/SUP.pm	2009-08-03 07:11:24 UTC (rev 7529)
@@ -116,7 +116,7 @@
         $ip_class = "russia" if $flags{ip_russia};
     }
 
-    if ($u && $u->in_class('sponsored') && $u->sponsored_u->sponsor->domain eq 'sup') {
+    if ($u && $u->in_class('sponsored') && $u->sponsored_u && $u->sponsored_u->sponsor->domain eq 'sup') {
         return 1;
     }
     

Modified: trunk/cgi-bin/LJ/Sponsored/User.pm
===================================================================
--- trunk/cgi-bin/LJ/Sponsored/User.pm	2009-08-03 06:20:00 UTC (rev 7528)
+++ trunk/cgi-bin/LJ/Sponsored/User.pm	2009-08-03 07:11:24 UTC (rev 7529)
@@ -633,7 +633,7 @@
     my $u = shift;
 
     ## If a user is already sponsored return her sponsor domain
-    if ($u->is_sponsored) {
+    if ($u->is_sponsored && $u->sponsored_u) {
         return $u->sponsored_u->sponsor->domain;
     }
 

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