diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index c0b0adb..676220d 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -124,9 +124,14 @@ EOF
if ! File.exist?(file) || File.mtime(file) <= File.mtime(subdir_file)
FileUtils.cp(subdir_file, file)
subdir_file_html = "#{subdir_file}.html"
- FileUtils.cp(subdir_file_html, "#{file}.html")
+ if File.exist?(subdir_file_html)
+ FileUtils.cp(subdir_file_html, "#{file}.html")
+ html = "#{d}/#{subdir_file_html}"
+ else
+ html = nil
+ end
log_item = {log: "#{d}/#{subdir_file}",
- html: "#{d}/#{subdir_file_html}",
+ html: html,
status: status[name][d_name]}
if ! log[name]
log[name] = {}