diff --git a/server/infra/database/CountryRepository.ts b/server/infra/database/CountryRepository.ts index 29604629..6a2e64b9 100644 --- a/server/infra/database/CountryRepository.ts +++ b/server/infra/database/CountryRepository.ts @@ -43,7 +43,7 @@ export default class CountryRepository extends BaseRepository { const object = await this.session .getDB() .raw(sql); - if (!object && object.rows.length !== 1) { + if (!object || object.rows.length <= 0) { throw new HttpError(404, `Can not found ${this.tableName} by lat:${lat} lon:${lon}`); } return object.rows;