fix error for blocks

This commit is contained in:
janson 2022-06-27 23:05:21 +08:00
parent e8018ded1b
commit 070c304fad
3 changed files with 3 additions and 3 deletions

View File

@ -267,7 +267,7 @@ function blocks()
local obj = jsonc.parse(ret)
for _, val in pairs(obj["blockdevices"]) do
local fsize = val["fssize"]
if string.len(fsize) > 10 and val["mountpoint"] then
if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
-- fsize > 1G
vals[#vals+1] = val["mountpoint"]
end

View File

@ -255,7 +255,7 @@ function blocks()
local obj = jsonc.parse(ret)
for _, val in pairs(obj["blockdevices"]) do
local fsize = val["fssize"]
if string.len(fsize) > 10 and val["mountpoint"] then
if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
-- fsize > 1G
vals[#vals+1] = val["mountpoint"]
end

View File

@ -245,7 +245,7 @@ function blocks()
local obj = jsonc.parse(ret)
for _, val in pairs(obj["blockdevices"]) do
local fsize = val["fssize"]
if string.len(fsize) > 10 and val["mountpoint"] then
if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
-- fsize > 1G
vals[#vals+1] = val["mountpoint"]
end