[livejournal] r21993: LJSUP-12252: prevent the subtraction of ...
Committer: vad
LJSUP-12252: prevent the subtraction of the user interests counter, if it is equal to zeroU trunk/htdocs/interests.bml
Modified: trunk/htdocs/interests.bml
===================================================================
--- trunk/htdocs/interests.bml 2012-05-18 12:13:29 UTC (rev 21992)
+++ trunk/htdocs/interests.bml 2012-05-18 12:17:46 UTC (rev 21993)
@@ -327,7 +327,7 @@
my $dbh = LJ::get_db_writer();
$dbh->do("DELETE FROM $uitable WHERE userid=? AND intid IN ($intid_in)",
undef, $u->{'userid'});
- $dbh->do("UPDATE interests SET intcount=intcount-1 WHERE intid IN ($intid_in)");
+ $dbh->do("UPDATE interests SET intcount=intcount-1 WHERE intid IN ($intid_in) AND intcount > 0");
$deleted = 1;
}
if (@toadd) {
