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
|
||||
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",
|
||||
[
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user