]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Fix bustage due to bug 793963. Some very old bugs may have no comments
authorFrédéric Buclin <LpSolit@gmail.com>
Mon, 25 Nov 2013 13:28:11 +0000 (14:28 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Mon, 25 Nov 2013 13:28:11 +0000 (14:28 +0100)
Bugzilla/Bug.pm

index 9669352cd0c42112c0c21067930457144f7e7fb1..a7be3812df87da29bd4d9625dfc83cff94ca6e7d 100644 (file)
@@ -3416,7 +3416,8 @@ sub comments {
             $comment->{count} = $count++;
             $comment->{bug} = $self;
         }
-        Bugzilla::Comment->preload($self->{'comments'});
+        # Some bugs may have no comments when upgrading old installations.
+        Bugzilla::Comment->preload($self->{'comments'}) if $count;
     }
     my @comments = @{ $self->{'comments'} };