From 4050ba5f922a01fa7435abbbb3c0b295ca7c9b52 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Wed, 11 Sep 2024 19:22:29 +0100 Subject: [PATCH] Avoid optional chaining syntax So that we can run on older Node.js versions --- .../multiwikiserver/modules/store/sql-tiddler-store.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js index 69d09166b..bd3c80dee 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js @@ -159,7 +159,7 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields, exist if(fileSize <= attachmentSizeLimit) { const existingAttachmentMeta = this.attachmentStore.getAttachmentMetadata(existing_attachment_blob); const hasCanonicalField = !!tiddlerFields._canonical_uri; - const skipAttachment = hasCanonicalField && (tiddlerFields._canonical_uri === (existingAttachmentMeta?._canonical_uri || existing_canonical_uri)); + const skipAttachment = hasCanonicalField && (tiddlerFields._canonical_uri === (existingAttachmentMeta ? existingAttachmentMeta._canonical_uri : existing_canonical_uri)); shouldProcessAttachment = !skipAttachment; } else { shouldProcessAttachment = false; @@ -174,7 +174,7 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields, exist _canonical_uri: tiddlerFields._canonical_uri }); - if(tiddlerFields?._canonical_uri) { + if(tiddlerFields && tiddlerFields._canonical_uri) { delete tiddlerFields._canonical_uri; }