Skip to content

Commit e38a108

Browse files
author
David Nahodyl
committed
fixed count to return 0 when error code 401 is received
1 parent f3a15cb commit e38a108

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Database/Eloquent/FMEloquentBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,14 @@ public function count($columns = '*'): int
317317
$query = $this->query->limit(1);
318318
try {
319319
$response = $this->getQuery()->getConnection()->performFind($query);
320+
$count = $response['response']['dataInfo']['foundCount'];
320321
} catch (FileMakerDataApiException $e) {
321322
if ($e->getCode() == 401) {
322323
$count = 0;
323324
} else {
324325
throw $e;
325326
}
326327
}
327-
$count = $response['response']['dataInfo']['foundCount'];
328328
return $count;
329329
}
330330

0 commit comments

Comments
 (0)