mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
lua_utils.lua: fix issue with prefs assignment via string input fields
This commit fixes a nil value issue happening when trying to assign preferences with string input fields.
This commit is contained in:
parent
cb54f100d5
commit
939ffa6c7d
1 changed files with 6 additions and 2 deletions
|
|
@ -1417,11 +1417,15 @@ end
|
|||
function prefsInputField(label, comment, key, value)
|
||||
if(_GET[key] ~= nil) then
|
||||
k = "ntopng.prefs."..key
|
||||
v = tonumber(_GET[key])
|
||||
if((v > 0) and (v < 86400)) then
|
||||
v_s = _GET[key]
|
||||
v = tonumber(v_s)
|
||||
if(v ~= nil and (v > 0) and (v < 86400)) then
|
||||
-- print(k.."="..v)
|
||||
ntop.setCache(k, tostring(v))
|
||||
value = v
|
||||
elseif (v_s ~= nil) then
|
||||
ntop.setCache(k, v_s)
|
||||
value = v_s
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue