From 4a9dfb95671ddc0202e0e7f0448a26b4a200940b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 28 Jan 2021 17:49:34 +0100 Subject: [PATCH] fix copy url to clipboard action for undownloaded files --- src/main/java/eu/siacs/conversations/ui/util/ShareUtil.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/util/ShareUtil.java b/src/main/java/eu/siacs/conversations/ui/util/ShareUtil.java index 3abef56f7..fb92f47bf 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/ShareUtil.java +++ b/src/main/java/eu/siacs/conversations/ui/util/ShareUtil.java @@ -96,7 +96,8 @@ public class ShareUtil { resId = R.string.file_url; url = message.getFileParams().url.toString(); } else { - url = message.getBody().trim(); + final Message.FileParams fileParams = message.getFileParams(); + url = (fileParams != null && fileParams.url != null) ? fileParams.url.toString() : message.getBody().trim(); resId = R.string.file_url; } if (activity.copyTextToClipboard(url, resId)) {