From 9bb7001645fe2418a4aee046239263890d81a5ac Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 16 Feb 2015 14:48:10 +1030 Subject: [PATCH] Better check for user property in command validators --- src/Flarum/Core/Support/CommandValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Flarum/Core/Support/CommandValidator.php b/src/Flarum/Core/Support/CommandValidator.php index ad5f7737f..523645216 100644 --- a/src/Flarum/Core/Support/CommandValidator.php +++ b/src/Flarum/Core/Support/CommandValidator.php @@ -17,10 +17,10 @@ class CommandValidator public function validate($command) { - if (! $command->user) { + if (empty($command->user)) { throw new InvalidArgumentException('Empty argument [user] in command ['.get_class($command).']'); } - + $validator = $this->validator->make(get_object_vars($command), $this->rules); $this->fireValidationEvent([$validator, $command]);