]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
avoid uninitialized value warning when running -dumpsetup
authorJoey Hess <joey@kitenet.net>
Fri, 25 Feb 2011 21:32:36 +0000 (17:32 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 25 Feb 2011 21:32:36 +0000 (17:32 -0400)
Here wikistatedir has not been configured.

IkiWiki/Plugin/transient.pm

index 9811aa010e3d31672dd930596082f83d69d7a02c..c0ad5fc11476ef4442cb64e81c7f5580e3795942 100644 (file)
@@ -25,10 +25,12 @@ sub getsetup () {
 our $transientdir;
 
 sub checkconfig () {
-       $transientdir = $config{wikistatedir}."/transient";
-       # add_underlay treats relative underlays as relative to the installed
-       # location, not the cwd. That's not what we want here.
-       IkiWiki::add_literal_underlay($transientdir);
+       if (defined $config{wikistatedir}) {
+               $transientdir = $config{wikistatedir}."/transient";
+               # add_underlay treats relative underlays as relative to the installed
+               # location, not the cwd. That's not what we want here.
+               IkiWiki::add_literal_underlay($transientdir);
+       }
 }
 
 sub change (@) {