Skip to content

Commit

Permalink
use ubus.STATUS_NOT_FOUND if the uspot instance has not been found
Browse files Browse the repository at this point in the history
while the argument is valid

Signed-off-by: Pierre Joye <[email protected]>
  • Loading branch information
pierrejoye committed Jan 28, 2025
1 parent 644fd6f commit f722537
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions files/usr/share/uspotfilter/uspotfilter.uc
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function run_service() {
if (!uspot || !address)
return ubus.STATUS_INVALID_ARGUMENT;
if (!(uspot in uspots))
return ubus.STATUS_INVALID_ARGUMENT;
return ubus.STATUS_NOT_FOUND;

let state = client_allowed(uspot, address);
let device = uspots[uspot].settings.device;
Expand Down Expand Up @@ -298,7 +298,7 @@ function run_service() {
if (!uspot || !address)
return ubus.STATUS_INVALID_ARGUMENT;
if (!(uspot in uspots))
return ubus.STATUS_INVALID_ARGUMENT;
return ubus.STATUS_NOT_FOUND;
if (flush) {
if (!uspots[uspot].clients[address])
Expand Down Expand Up @@ -354,7 +354,7 @@ function run_service() {
if (!uspot || !address)
return ubus.STATUS_INVALID_ARGUMENT;
if (!(uspot in uspots))
return ubus.STATUS_INVALID_ARGUMENT;
return ubus.STATUS_NOT_FOUND;
if (!uspots[uspot].clients[address])
return 0;
Expand All @@ -380,7 +380,7 @@ function run_service() {
if (!uspot)
return ubus.STATUS_INVALID_ARGUMENT;
if (!(uspot in uspots))
return ubus.STATUS_INVALID_ARGUMENT;
return ubus.STATUS_NOT_FOUND;
let clients = uspots[uspot].clients;
Expand Down

0 comments on commit f722537

Please sign in to comment.