Skip to content

Commit

Permalink
fix(status): fix rpc resources_get_version
Browse files Browse the repository at this point in the history
  • Loading branch information
muink committed Dec 29, 2023
1 parent 38574ee commit 2b4152b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions root/usr/share/rpcd/ucode/luci.homeproxy
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,11 @@ const methods = {
args: { type: 'type', repo: 'repo' },
call: function(req) {
const versions = trim(readfile(`${HP_DIR}/resources/${req.args?.type}.ver`));
if (req.args?.repo) {
if (req.args?.repo && versions) {
const vers_arr = values(json(versions));
for (obj in vers_arr) {
if (obj.repo === req.args?.repo) {
if (obj.repo === req.args?.repo)
return { version: obj.version, error: 0 };
}
}
return { version: '', error: 1 };
} else
Expand Down

0 comments on commit 2b4152b

Please sign in to comment.