diff --git a/src/Diagram.js b/src/Diagram.js
index <HASH>..<HASH> 100644
--- a/src/Diagram.js
+++ b/src/Diagram.js
@@ -18,7 +18,7 @@ class Diagram {
     // console.log('this.type', this.type, diagrams[this.type]);
     // Setup diagram
     this.db = diagrams[this.type].db;
-    this.db.clear();
+    this.db.clear?.();
 
     this.renderer = diagrams[this.type].renderer;
     this.parser = diagrams[this.type].parser;
fix(Diagram): C4C diagram does not have a db.clear method