only check for held attachments when operating on an attachment
authorJoey Hess <joey@kitenet.net>
Fri, 15 Jul 2011 22:42:00 +0000 (18:42 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 15 Jul 2011 22:42:00 +0000 (18:42 -0400)
IkiWiki/Plugin/remove.pm

index a58f87fb3b045e7876f4a6912c987a1774789086..14ac01c9bcfc390f370f1a8fca74c3b51d7f0baa 100644 (file)
@@ -120,7 +120,7 @@ sub removal_confirm ($$@) {
                
        # Special case for unsaved attachments.
        foreach my $page (@pages) {
                
        # Special case for unsaved attachments.
        foreach my $page (@pages) {
-               if (IkiWiki::Plugin::attachment->can("is_held_attachment")) {
+               if ($attachment && IkiWiki::Plugin::attachment->can("is_held_attachment")) {
                        my $f=IkiWiki::Plugin::attachment::is_held_attachment($page);
                        if (defined $f) {
                                require IkiWiki::Render;
                        my $f=IkiWiki::Plugin::attachment::is_held_attachment($page);
                        if (defined $f) {
                                require IkiWiki::Render;