[dw-free] Filter to entry sometimes breaks
[commit: http://hg.dwscoalition.org/dw-free/rev/edc95acb4e6a]
http://bugs.dwscoalition.org/show_bug.cgi?id=2668
Add some error checking in case an entry or comment was deleted.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2668
Add some error checking in case an entry or comment was deleted.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/LJ/NotificationInbox.pm
-------------------------------------------------------------------------------- diff -r 7a62622d9127 -r edc95acb4e6a cgi-bin/LJ/NotificationInbox.pm --- a/cgi-bin/LJ/NotificationInbox.pm Mon Jun 07 03:03:52 2010 +0000 +++ b/cgi-bin/LJ/NotificationInbox.pm Mon Jun 07 12:18:28 2010 +0800 @@ -178,7 +178,12 @@ sub subset_items { sub singleentry_items { my ( $self, $itemid ) = @_; - return grep { $_->event->class eq "LJ::Event::JournalNewComment" && $_->event->comment->entry->ditemid == $itemid } $self->items; + return grep { + $_->event->class eq "LJ::Event::JournalNewComment" + && $_->event->comment + && $_->event->comment->entry # may have been deleted, which breaks all filter to entry comments + && $_->event->comment->entry->ditemid == $itemid + } $self->items; } # return flagged notifications --------------------------------------------------------------------------------