vernesong / OpenClash

A Clash Client For OpenWrt
MIT License
17.55k stars 3.18k forks source link

clash 第一次启动时 luci 报错 #2169

Closed fanck0605 closed 2 years ago

fanck0605 commented 2 years ago

错误日志:

Mon Mar 21 01:01:28 2022 daemon.err uhttpd[455]: stack traceback:
Mon Mar 21 01:01:28 2022 daemon.err uhttpd[455]:    [C]: in function 'find'
Mon Mar 21 01:01:28 2022 daemon.err uhttpd[455]:    /usr/lib/lua/luci/controller/openclash.lua:1362: in function 'trans_line'
Mon Mar 21 01:01:28 2022 daemon.err uhttpd[455]:    /usr/lib/lua/luci/controller/openclash.lua:185: in function 'startlog'
Mon Mar 21 01:01:28 2022 daemon.err uhttpd[455]:    /usr/lib/lua/luci/controller/openclash.lua:899: in function </usr/lib/lua/luci/controller/openclash.lua:896>
Mon Mar 21 01:01:28 2022 daemon.err uhttpd[455]: /usr/lib/lua/luci/controller/openclash.lua:1362: bad argument #1 to 'find' (string expected, got nil)

应该是因为这边引用了个未定义的变量 https://github.com/vernesong/OpenClash/blob/667880c196c0cb760a0872f4706fe1589e3edd5e/luci-app-openclash/luasrc/controller/openclash.lua#L185

fanck0605 commented 2 years ago

lua 不是有 IDE 能用吗。配配环境 ,局部变量应该还是能检测的。