From ac1226031eb5c5f9b8fe528420483f4d8828c73d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 22 Jul 2008 13:23:11 -0400 Subject: avoid uninitialised value --- IkiWiki/Plugin/attachment.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm index 8f9d7f5a4..2a662c0d1 100644 --- a/IkiWiki/Plugin/attachment.pm +++ b/IkiWiki/Plugin/attachment.pm @@ -430,6 +430,9 @@ sub match_user ($$;@) { #{{{ if (defined $params{user} && lc $params{user} eq lc $user) { return IkiWiki::SuccessReason->new("user is $user"); } + elsif (! defined $params{user}) { + return IkiWiki::FailReason->new("not logged in"); + } else { return IkiWiki::FailReason->new("user is $params{user}, not $user"); } -- cgit v1.2.3