correctly return if arguments are missing
This commit is contained in:
parent
2739ebed2a
commit
a55c7a9929
1 changed files with 2 additions and 2 deletions
|
@ -13,10 +13,10 @@ async function getServiceState(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function setServiceState(name, args) {
|
async function setServiceState(name, args) {
|
||||||
if (name === undefined || args === undefined) {
|
if (name === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let state = args.get('state');
|
let state = args?.get('state');
|
||||||
if (state === undefined) {
|
if (state === undefined) {
|
||||||
const msg = 'missing argument \'state\', pass either \'active\', \'inactive\' or \'toggle\'';
|
const msg = 'missing argument \'state\', pass either \'active\', \'inactive\' or \'toggle\'';
|
||||||
logger.debug(msg);
|
logger.debug(msg);
|
||||||
|
|
Loading…
Reference in a new issue