mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Chore: findOne now returns empty documents instead of false on miss
This commit is contained in:
1 parent
e404c21e8d
commit
27cd99bac0
1 file changed
+2
-2
@@ -175,7 +175,7 @@ class TimeLimit extends TimeLimitAdapter
|
||||
Query::equal('time', [$datetime]),
|
||||
]);
|
||||
|
||||
if ($data === false) {
|
||||
if ($data->isEmpty()) {
|
||||
$data = [
|
||||
'$permissions' => [],
|
||||
'key' => $key,
|
||||
@@ -193,7 +193,7 @@ class TimeLimit extends TimeLimitAdapter
|
||||
Query::equal('time', [$datetime]),
|
||||
]);
|
||||
|
||||
if ($data !== false && $data instanceof Document) {
|
||||
if (!$data->isEmpty()) {
|
||||
$count = $data->getAttribute('count', 0);
|
||||
if (\is_numeric($count)) {
|
||||
$this->count = intval($count);
|
||||
|
||||
Reference in new issue
Block a user