Defect #2360

Missing checks for nils in the WikiController

Added by Eric Davis almost 9 years ago. Updated almost 9 years ago.

Status:ClosedStart date:2008-12-19
Priority:NormalDue date:
Assignee:Eric Davis% Done:

0%

Category:Wiki
Target version:0.8
Resolution:Fixed Affected version:

Description

I had a public page on my wiki which I moved to a private project. Web spiders have cached the url and are trying to hit the pages. Instead of getting 404 errors though, they are throwing NoMethodErrors on a nil object. It looks like several actions in the WikiController are not checking for nil object before calling methods on them

  • undefined method `diff' for nil:NilClass [RAILS_ROOT]/app/controllers/wiki_controller.rb:129:in `diff'
  • undefined method `annotate' for nil:NilClass [RAILS_ROOT]/app/controllers/wiki_controller.rb:135:in `annotate'
  • undefined method `content' for nil:NilClass [RAILS_ROOT]/app/controllers/wiki_controller.rb:115:in `history'

Associated revisions

Revision 2145
Added by Jean-Philippe Lang almost 9 years ago

Check that wiki page exists before processing (#2360).

History

#1 Updated by Jean-Philippe Lang almost 9 years ago

  • Status changed from New to Closed
  • Target version set to 0.8
  • Resolution set to Fixed

Fixed in r2145.
Just saw that you assigned it to you, sorry.

#2 Updated by Eric Davis almost 9 years ago

Jean-Philippe Lang wrote:

Just saw that you assigned it to you, sorry.

It's ok. I assign issues to myself that I'm confidant that I can handle, feel free to steal them from me.

Also available in: Atom PDF