handle non existent $indexlink
authorGuillaume Cottenceau <gcottenc@gmail.com>
Wed, 3 Nov 2010 08:19:22 +0000 (09:19 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Wed, 3 Nov 2010 08:19:22 +0000 (09:19 +0100)
bin/booh-backend

index ab64b2c..c81bb80 100755 (executable)
@@ -1288,7 +1288,7 @@ def walk_source_dir
                     i.gsub!(/~~current_size_js~~/, size2js(sizeobj['name']))
                     i.gsub!(/~~madewith~~/, $madewith || '')
                     i.gsub!(/~~indexlink~~/, $indexlink || '')
-                    if $indexlink.empty?
+                    if !$indexlink || $indexlink.empty?
                        i.gsub!(/~~ifindexlink\?~~(.+?)~~fi~~/) { }
                     else
                        i.gsub!(/~~ifindexlink\?~~(.+?)~~fi~~/) { $1 }
@@ -1442,7 +1442,7 @@ def walk_source_dir
                     i.gsub!(/~~htmlsuffix~~/, $htmlsuffix)
                     i.gsub!(/~~madewith~~/, $madewith || '')
                     i.gsub!(/~~indexlink~~/, $indexlink || '')
-                    if $indexlink.empty?
+                    if !$indexlink || $indexlink.empty?
                         i.gsub!(/~~ifindexlink\?~~(.+?)~~fi~~/) { }
                     else
                         i.gsub!(/~~ifindexlink\?~~(.+?)~~fi~~/) { $1 }
@@ -1598,7 +1598,7 @@ def walk_source_dir
                 i.gsub!(/~~thumbnails~~/, html_index)
                 i.gsub!(/~~madewith~~/, $madewith || '')
                 i.gsub!(/~~indexlink~~/, $indexlink || '')
-               if $indexlink.empty? 
+                if !$indexlink || $indexlink.empty?
                    i.gsub!(/~~ifindexlink\?~~(.+?)~~fi~~/) { }
                 else
                    i.gsub!(/~~ifindexlink\?~~(.+?)~~fi~~/) { $1 }