mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge pull request #8391 from appwrite/lohanidamodar-patch-3
Fix: throwing exception when optional array attribute does not exist
This commit is contained in:
@@ -625,6 +625,11 @@ class Response extends SwooleResponse
|
||||
}
|
||||
}
|
||||
|
||||
if (!$data->isSet($key) && !$rule['required']) { // set output key null if data key is not set and required is false
|
||||
$output[$key] = null;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($rule['array']) {
|
||||
if (!is_array($data[$key])) {
|
||||
throw new Exception($key . ' must be an array of type ' . $rule['type']);
|
||||
|
||||
Reference in New Issue
Block a user