summaryrefslogtreecommitdiffstats
path: root/votes.cgi
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-06-28 09:14:56 +0200
committerbbaetz%acm.org <>2003-06-28 09:14:56 +0200
commit3bdb6be579bd5f3a98282014b0033b12a172de22 (patch)
treed41a409bcac6b49361ffee1bf8e5c559c9164c5b /votes.cgi
parent4f6b75a65628b0d86c760309dd81dd03f5c6d308 (diff)
downloadbugzilla-3bdb6be579bd5f3a98282014b0033b12a172de22.tar.gz
bugzilla-3bdb6be579bd5f3a98282014b0033b12a172de22.tar.xz
Bug 193575 - Internal server error from votes.cgi
patch by bugzilla@chimpychompy.org (GavinS) r=bbaetz, a=justdave
Diffstat (limited to 'votes.cgi')
-rwxr-xr-xvotes.cgi7
1 files changed, 6 insertions, 1 deletions
diff --git a/votes.cgi b/votes.cgi
index 1c7bc7816..dfa55b91d 100755
--- a/votes.cgi
+++ b/votes.cgi
@@ -135,7 +135,8 @@ sub show_user {
# special error handling should go away.
$who || ThrowUserError("invalid_username", {name => $name});
- my $canedit = 1 if ($name eq Bugzilla->user->login);
+ my $canedit = 1 if (Bugzilla->user &&
+ $name eq Bugzilla->user->login);
SendSQL("LOCK TABLES bugs READ, products READ, votes WRITE,
cc READ, bug_group_map READ, user_group_map READ,
@@ -200,6 +201,10 @@ sub show_user {
opened => IsOpenedState($status) });
}
+ # In case we didn't populate this earlier (i.e. an error, or
+ # a not logged in user viewing a users votes)
+ $maxvotesperbug{$product} ||= 0;
+
$onevoteonly = 1 if (min($::prodmaxvotes{$product},
$maxvotesperbug{$product}) == 1);