diff --git a/plugs/directive/query_directive.ts b/plugs/directive/query_directive.ts index efc35a4..899f28c 100644 --- a/plugs/directive/query_directive.ts +++ b/plugs/directive/query_directive.ts @@ -26,7 +26,11 @@ export async function queryDirectiveRenderer( const rendered = await renderTemplate(parsedQuery.render, results[0]); return rendered.trim(); } else { - return jsonToMDTable(results[0]); + if (results[0].length === 0) { + return "No results"; + } else { + return jsonToMDTable(results[0]); + } } } else { throw new Error(`Too many query results: ${results.length}`);