mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-16 20:55:20 +03:00
needed nil check for "attr" in reporter.lua here: `if attr and attr.mode == "directory" then` and here: `if attr and attr.mode == "file" and fileMatches(filename, '.%.lua$') then` Signed-off-by: Hani Shawa <hani.shawa@ev-box.com>
20 lines
768 B
Diff
20 lines
768 B
Diff
--- a/src/luacov/reporter.lua
|
|
+++ b/src/luacov/reporter.lua
|
|
@@ -25,7 +25,7 @@
|
|
entry=directory.."/"..entry
|
|
local attr=lfs.attributes(entry)
|
|
coroutine.yield(entry,attr)
|
|
- if attr.mode == "directory" then
|
|
+ if attr and attr.mode == "directory" then
|
|
yieldtree(entry)
|
|
end
|
|
end
|
|
@@ -95,7 +95,7 @@
|
|
os.exit(1)
|
|
end
|
|
for filename, attr in dirtree("./") do
|
|
- if attr.mode == "file" and fileMatches(filename, '.%.lua$') then
|
|
+ if attr and attr.mode == "file" and fileMatches(filename, '.%.lua$') then
|
|
local file_stats = {}
|
|
file_stats[0] = 0
|
|
if luacov.file_included(filename) then
|