fix: Adds validation fixes for commands (#401)
Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
This commit is contained in:
@@ -32,7 +32,7 @@ func validate(arguments: Array):
|
|||||||
)
|
)
|
||||||
return false
|
return false
|
||||||
if not arguments[1] in ["default", "off"] \
|
if not arguments[1] in ["default", "off"] \
|
||||||
or not ResourceLoader.exists(arguments[1]):
|
and not ResourceLoader.exists(arguments[1]):
|
||||||
escoria.logger.report_errors(
|
escoria.logger.report_errors(
|
||||||
"SetSoundStateCommand.validate: invalid sound",
|
"SetSoundStateCommand.validate: invalid sound",
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ func run() -> int:
|
|||||||
var prepared_arguments = argument_descriptor.prepare_arguments(
|
var prepared_arguments = argument_descriptor.prepare_arguments(
|
||||||
self.parameters
|
self.parameters
|
||||||
)
|
)
|
||||||
if argument_descriptor.validate(self.name, prepared_arguments):
|
if argument_descriptor.validate(self.name, prepared_arguments) and\
|
||||||
|
command_object.validate(prepared_arguments):
|
||||||
escoria.logger.debug("Running command %s with parameters %s" % [
|
escoria.logger.debug("Running command %s with parameters %s" % [
|
||||||
self.name,
|
self.name,
|
||||||
prepared_arguments
|
prepared_arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user