fix: Do not generate empty INSERT graph.

Fixes https://github.com/solid/community-server/issues/383
This commit is contained in:
Ruben Verborgh
2020-12-02 21:39:38 +01:00
parent c2b189184b
commit 0ecbffa885
2 changed files with 22 additions and 1 deletions

View File

@@ -238,7 +238,9 @@ export class SparqlDataAccessor implements DataAccessor {
if (triples) {
// This needs to be first so it happens before the insert
updates.unshift(this.sparqlUpdateDeleteAll(name));
insert.push(this.sparqlUpdateGraph(name, triples));
if (triples.length > 0) {
insert.push(this.sparqlUpdateGraph(name, triples));
}
}
return {