OSDN Git Service

Plugin::Preprocessor: fix get_path()
authorhylom <hylom@users.sourceforge.jp>
Fri, 15 Feb 2019 11:03:40 +0000 (20:03 +0900)
committerhylom <hylom@users.sourceforge.jp>
Fri, 15 Feb 2019 11:03:40 +0000 (20:03 +0900)
src/newslash_web/lib/Newslash/Plugin/Preprocessor.pm

index 7b4d678..9438e35 100644 (file)
@@ -286,14 +286,11 @@ sub get_path {
         # regenerate contents
         my $targets = $self->{conf}->{targets} || {};
         if ($targets->{$path}) {
-            my $rs = $self->_generate($targets->{$path});
-            if ($rs) {
-                $content = $rs->{content};
-            }
+            $content = $self->_generate($targets->{$path});
         }
     }
 
-    if ($content) {
+    if ($content && $content->{path}) {
         return $content->{path};
     }
     else {