Skip to content

Reader crashes on empty feeds #129

@mawise

Description

@mawise

I observed this with a Substack feed for someone with no posts. The XML of the feed is valid but has no entries.

F, [2024-12-30T01:43:39.847849 #29150] FATAL -- : [321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6] ActionView::Template::Error (undefined method `link' for nil:NilClass):
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]     31: <% end %>
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]     32:
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]     33: <% unless @feed.nil? %>
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]     34:   <p><strong>Feed Name: </strong><%= link_to sanitize(@feed.name, tags:[], attributes:[]), @feed.feed_entries.first.link %></p>
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]     35:   <p><strong>Feed URL: </strong><%= @feed.url %>
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]     36:   <br/>
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]     37:   <p><%= link_to 'Delete this feed', feed_path(@feed),
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6]
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6] app/views/feeds/read.html.erb:34
[321b22bc-69c2-4ec9-8bef-ccf95ee08ab6] app/controllers/feeds_controller.rb:109:in `read_feed'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions