Fix some validation errors

This commit is contained in:
Alex Cabal 2023-09-01 12:42:25 -05:00
parent fcde084b2c
commit b919a7e829
2 changed files with 11 additions and 5 deletions

View file

@ -46,10 +46,16 @@ class PollVote extends PropertiesBase{
if($this->PollItem === null){
$error->Add(new Exceptions\InvalidPollException());
}
}
if(!$this->PollItem->Poll->IsActive()){
$error->Add(new Exceptions\PollClosedException());
else{
if($this->PollItem->Poll === null){
$error->Add(new Exceptions\InvalidPollException());
}
else{
if(!$this->PollItem->Poll->IsActive()){
$error->Add(new Exceptions\PollClosedException());
}
}
}
}
if(!$error->HasExceptions){