We're updating the issue view to help you get more done.Learn more

500 error if attempting to access an FAQ that doesn't exist

Steps to reproduce

  1. Make up an FAQ that does not exist, e.g. technical-questions, and attempt to access it: https://test.archiveofourown.org/faq/technical-questions

What happens

A 500 error

What should happen instead

A 404 error

Notes

There are constantly a bunch of these in New Relic, generally due to incorrect links on Tumblr. The relevant bit of the error:

1 2 3 4 5 Error message NoMethodError: undefined method `questions' for nil:NilClass Stack trace (show Rails) …80611183634/app/controllers/archive_faqs_controller.rb: 24:in `show'

Relevant line(s) of code:

1 2 3 @archive_faq = ArchiveFaq.find_by(slug: params[:id]) if params[:language_id] == "en" @questions= @archive_faq.questions

Status

Assignee

redsummernight

Reporter

Sarken

Roadmap

FAQ

Priority

Medium

Affects versions

0.9.214

Fix versions

Components

BackEnd

Difficulty

Medium

Milestone

Internal 0.9