diff --git a/light9/web/SyncedGraph.ts b/light9/web/SyncedGraph.ts --- a/light9/web/SyncedGraph.ts +++ b/light9/web/SyncedGraph.ts @@ -51,7 +51,10 @@ export class SyncedGraph { this.cachedFloatValues = new Map(); // s + '|' + p -> number this.cachedUriValues = new Map(); // s + '|' + p -> Uri - this._applyPatch(patchToDeleteEntireGraph(this.graph)); + const p = patchToDeleteEntireGraph(this.graph); + if (!p.isEmpty()) { + this._applyPatch(p); + } // if we had a Store already, this lets N3.Store free all its indices/etc this.graph = new N3.Store(); this.rebuildPrefixFuncs(this.prefixes);