Skip to content

Commit

Permalink
fix(query): no result is not interpreted as an error
Browse files Browse the repository at this point in the history
  • Loading branch information
vhf committed Oct 30, 2019
1 parent 459b56f commit 72262cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class Query {
public async execute(): Promise<any[]> {
const query = await this.toSparql();
const results = await this.fetcher.select(query);
if (results.every((obj) => obj.key && obj.value)) {
if (results.length && results.every((obj) => obj.key && obj.value)) {
const error = results.reduce((obj, {key, value}) => {
obj[key] = value;
return obj;
Expand Down

0 comments on commit 72262cf

Please sign in to comment.