]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 686904: Removing an invalid URL from the See Also field crashes Bugzilla
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 19 Sep 2011 15:35:42 +0000 (17:35 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 19 Sep 2011 15:35:42 +0000 (17:35 +0200)
r=timello a=LpSolit

Bugzilla/Bug.pm

index 2b526588fffce509ef0310ca19f507b698c8b2ea..b2afe697210d6d0f410981506092d3bfec750120 100644 (file)
@@ -2886,7 +2886,8 @@ sub remove_see_also {
     # Since we remove also the url from the referenced bug,
     # we need to notify changes for that bug too.
     $removed_bug_url = $removed_bug_url->[0];
-    if ($removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local')
+    if ($removed_bug_url
+        and $removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local')
         and defined $removed_bug_url->ref_bug_url)
     {
         push @{ $self->{see_also_changes} },
@@ -3400,7 +3401,7 @@ sub reporter {
 sub see_also {
     my ($self) = @_;
     return [] if $self->{'error'};
-    if (!defined $self->{see_also}) {
+    if (!exists $self->{see_also}) {
         my $ids = Bugzilla->dbh->selectcol_arrayref(
             'SELECT id FROM bug_see_also WHERE bug_id = ?',
             undef, $self->id);