mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Do not throw exception if rule default is null but not required
This commit is contained in:
1 parent
ebcd1b23b6
commit
741779cdb8
1 file changed
+1
-1
@@ -325,7 +325,7 @@ class Response extends SwooleResponse
|
||||
$document = $model->filter($document);
|
||||
|
||||
foreach ($model->getRules() as $key => $rule) {
|
||||
if (!$document->isSet($key)) {
|
||||
if (!$document->isSet($key) && $rule['require']) { // do not set attribute in response if not required
|
||||
if (!is_null($rule['default'])) {
|
||||
$document->setAttribute($key, $rule['default']);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user