Skip to content

Commit

Permalink
Fixed issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rajkumardusad authored Feb 17, 2021
1 parent 75a21ff commit 6200741
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,10 @@ private function validate_required(array $data, string $data_key, array $rules)
* @return boolean
*/
private function validate_null(array $data, string $data_key, array $rules) : bool {
if((!empty($data[$data_key]) && $data[$data_key] !== 0 && $data[$data_key] !== false && $rules['null'] === true)) {
if(isset($data[$data_key]) && !empty($data[$data_key]) && $data[$data_key] !== 0 && $data[$data_key] !== false && $rules['null'] === true) {
$this->set_error($data_key, $rules, 'null');
return false;
} else if((empty($data[$data_key]) && $data[$data_key] !== 0 && $data[$data_key] !== false && $rules['null'] === false)) {
} else if(isset($data[$data_key]) && empty($data[$data_key]) && $data[$data_key] !== 0 && $data[$data_key] !== false && $rules['null'] === false) {
$this->set_error($data_key, $rules, 'null');
return false;
} else {
Expand Down

0 comments on commit 6200741

Please sign in to comment.