changeset 2293:c070f46c0761

you can ask to apply empty patch and it will no-op
author drewp@bigasterisk.com
date Tue, 30 May 2023 00:59:20 -0700
parents 0a11698fecc4
children 4031e511bca9
files light9/web/SyncedGraph.ts
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/SyncedGraph.ts	Mon May 29 23:37:08 2023 -0700
+++ b/light9/web/SyncedGraph.ts	Tue May 30 00:59:20 2023 -0700
@@ -156,12 +156,12 @@
       log("not connected-- dropping patch");
       return;
     }
-    if (patch.isEmpty()) throw "should not get to this point with empty patch";
-
-    this._applyPatch(patch);
-    if (this.client) {
-      log("sending patch:\n", patch.dump());
-      this.client.sendPatch(patch);
+    if (!patch.isEmpty()) {
+      this._applyPatch(patch);
+      if (this.client) {
+        log("sending patch:\n", patch.dump());
+        this.client.sendPatch(patch);
+      }
     }
     console.timeEnd("applyAndSendPatch");
   }