Skip to content

Commit

Permalink
Item9292: Fix the real root cause of the bug exposed by Sven's unit t…
Browse files Browse the repository at this point in the history
…est: viewfile could end up without a web, but not be aware of it

git-svn-id: http://svn.foswiki.org/trunk@8153 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed Jul 13, 2010
1 parent c380859 commit 5457828
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/lib/Foswiki/UI/Viewfile.pm
Expand Up @@ -87,6 +87,16 @@ sub viewfile {
}

$web = join('/', @web);
unless ( $web ) {
throw Foswiki::OopsException(
'attention',
def => 'no_such_attachment',
web => 'Unknown',
topic => 'Unknown',
status => 404,
params => [ 'viewfile', '?' ]
);
}

# Must set the web name, otherwise plugins may barf if
# they try to manipulate the topic context when an oops is generated.
Expand Down

0 comments on commit 5457828

Please sign in to comment.