aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2018-02-16 21:04:29 +0100
committersteckbrief <steckbrief@chefmail.de>2018-02-16 21:04:29 +0100
commit62bc6885db07423a434f945de9def863cb12b8c1 (patch)
tree0d60daca06a78d11546c02083c29f826581ae179 /src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java
parent84a2f8e41ac4d5a7ebc24f4eb5b99e9bc3029f1f (diff)
introduces cancel status for file transfers, fixes NPE in file sharing after picture resize
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java b/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java
index 55fd1b8e..709b3f20 100644
--- a/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java
@@ -5,6 +5,7 @@ import android.net.Uri;
import de.thedevstack.conversationsplus.ConversationsPlusApplication;
import de.thedevstack.conversationsplus.crypto.PgpEngine;
import de.thedevstack.conversationsplus.entities.Conversation;
+import de.thedevstack.conversationsplus.entities.FileParams;
import de.thedevstack.conversationsplus.entities.Message;
import de.thedevstack.conversationsplus.enums.FileStatus;
import de.thedevstack.conversationsplus.exceptions.FileCopyException;
@@ -45,6 +46,9 @@ public class ConversationUtil {
}
message.setCounterpart(conversation.getNextCounterpart());
//message.setType(Message.TYPE_FILE);
+ if (null == message.getFileParams()) {
+ message.setFileParams(new FileParams());
+ }
message.getFileParams().setFileStatus(FileStatus.NEEDS_UPLOAD);
String path = FileUtils.getPath(uri);
if (path != null) {