openwrt / openwrt/packages

luci-app-nut input validation error

Open
#21,531 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

I'm luci-app-nut.

When altering the the field [Off Delay(s)] under the driver config it requires an integer. When inputting for example 120 it gives the error:

/usr/lib/lua/luci/model/cbi/nut_server.lua:186: attempt to compare nil with string
stack traceback:
	/usr/lib/lua/luci/model/cbi/nut_server.lua:186: in function 'validate'
	/usr/lib/lua/luci/cbi.lua:1426: in function 'parse'
	/usr/lib/lua/luci/cbi.lua:1562: in function 'parse'
	/usr/lib/lua/luci/cbi.lua:248: in function 'parse'
	/usr/lib/lua/luci/cbi.lua:1184: in function 'parse'
	/usr/lib/lua/luci/cbi.lua:248: in function 'parse'
	/usr/lib/lua/luci/cbi.lua:387: in function 'parse'
	/usr/lib/lua/luci/dispatcher.lua:1410: in function '_cbi'
	/usr/lib/lua/luci/dispatcher.lua:1056: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:483: in function </usr/lib/lua/luci/dispatcher.lua:482>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at /usr/lib/lua/luci/model/cbi/nut_server.lua around line 186 and reproduce the error by changing the driver config's Off Delay(s) field to 120. Inspect the validate function and confirm the field accepts an integer without raising the reported comparison error; verify the form can be submitted successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.