summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMarc Hartmayer <hello@hartmayer.com>2020-05-24 11:01:53 +0200
committerMarc Hartmayer <hello@hartmayer.com>2020-05-24 11:31:25 +0200
commitb7105d7b5712dcdbf9dadebfddaba7691810da5c (patch)
tree721e9a40420393a9b0f89a4efa647407be34b958 /client
parentd5fbd50b760b1d3b84b5b4e8af3a8ed7608e2918 (diff)
downloadwekan-b7105d7b5712dcdbf9dadebfddaba7691810da5c.tar.gz
wekan-b7105d7b5712dcdbf9dadebfddaba7691810da5c.tar.bz2
wekan-b7105d7b5712dcdbf9dadebfddaba7691810da5c.zip
Fix error link not available
Fixes: Exception in template helper: TypeError: Cannot read property 'link' of undefined at constructor.attachmentLink (http://192.168.178.2:8080/app/app.js?hash=c0f961362c1318d650abaafcaaa6f6a77c8d11c8:3935:29) at http://192.168.178.2:8080/packages/blaze.js?hash=a20deb597f76789e171a9ee2b2e37d73fbb7ecda:1566:16 at http://192.168.178.2:8080/packages/peerlibrary_blaze-components.js?hash=4049f7e3116e3d9e865392b9546e70dc479b9add:395:66 at Function.Template._withTemplateInstanceFunc (http://192.168.178.2:8080/packages/blaze.js?hash=a20deb597f76789e171a9ee2b2e37d73fbb7ecda:3575:14) at http://192.168.178.2:8080/packages/peerlibrary_blaze-components.js?hash=4049f7e3116e3d9e865392b9546e70dc479b9add:394:27 at Spacebars.call (http://192.168.178.2:8080/packages/spacebars.js?hash=6f2be25813c793c0b363a6a91ebb029723f294ec:169:51) at Spacebars.mustacheImpl (http://192.168.178.2:8080/packages/spacebars.js?hash=6f2be25813c793c0b363a6a91ebb029723f294ec:106:25) at Object.Spacebars.mustache (http://192.168.178.2:8080/packages/spacebars.js?hash=6f2be25813c793c0b363a6a91ebb029723f294ec:110:39) at Blaze.View._render (http://192.168.178.2:8080/app/app.js?hash=c0f961362c1318d650abaafcaaa6f6a77c8d11c8:3328:42) at Blaze.View.doRender (http://192.168.178.2:8080/packages/blaze.js?hash=a20deb597f76789e171a9ee2b2e37d73fbb7ecda:1925:25)
Diffstat (limited to 'client')
-rw-r--r--client/components/activities/activities.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/components/activities/activities.js b/client/components/activities/activities.js
index 186200ec..4f15d421 100644
--- a/client/components/activities/activities.js
+++ b/client/components/activities/activities.js
@@ -151,8 +151,9 @@ BlazeComponent.extendComponent({
},
attachmentLink() {
- const attachment = this.currentData().activity.attachment();
- const link = attachment.link('original', '/');
+ const activity = this.currentData().activity;
+ const attachment = activity.attachment();
+ const link = attachment ? attachment.link('original', '/') : null;
// trying to display url before file is stored generates js errors
return (
(attachment &&
@@ -166,7 +167,7 @@ BlazeComponent.extendComponent({
attachment.name,
),
)) ||
- this.currentData().activity.attachmentName
+ activity.attachmentName
);
},