fix: Adds validation fixes for commands (#401)

Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
This commit is contained in:
Dennis Ploeger
2021-09-24 23:05:18 +02:00
committed by GitHub
parent 527fe84d3c
commit 2273d97d86
2 changed files with 3 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ func validate(arguments: Array):
)
return false
if not arguments[1] in ["default", "off"] \
or not ResourceLoader.exists(arguments[1]):
and not ResourceLoader.exists(arguments[1]):
escoria.logger.report_errors(
"SetSoundStateCommand.validate: invalid sound",
[

View File

@@ -113,7 +113,8 @@ func run() -> int:
var prepared_arguments = argument_descriptor.prepare_arguments(
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" % [
self.name,
prepared_arguments