mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-21 15:05:19 +00:00
Fixing Crashes
This commit is contained in:
parent
b237faa21d
commit
8fec296c11
@ -735,9 +735,10 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
|
||||
private fun restoreDraftIfNeeded() {
|
||||
val mediaURI = intent.data
|
||||
val mediaType = AttachmentManager.MediaType.from(intent.type)
|
||||
val mimeType = MediaUtil.getMimeType(this, mediaURI)
|
||||
if (mediaURI != null && mediaType != null) {
|
||||
if (AttachmentManager.MediaType.IMAGE == mediaType || AttachmentManager.MediaType.GIF == mediaType || AttachmentManager.MediaType.VIDEO == mediaType) {
|
||||
val media = Media(mediaURI, MediaUtil.getMimeType(this, mediaURI)!!, 0, 0, 0, 0, Optional.absent(), Optional.absent())
|
||||
if (mimeType != null && (AttachmentManager.MediaType.IMAGE == mediaType || AttachmentManager.MediaType.GIF == mediaType || AttachmentManager.MediaType.VIDEO == mediaType)) {
|
||||
val media = Media(mediaURI, mimeType, 0, 0, 0, 0, Optional.absent(), Optional.absent())
|
||||
startActivityForResult(MediaSendActivity.buildEditorIntent(this, listOf( media ), viewModel.recipient!!, ""), PICK_FROM_LIBRARY)
|
||||
return
|
||||
} else {
|
||||
|
@ -144,6 +144,7 @@ public class ThreadRecord extends DisplayRecord {
|
||||
.format().toString();
|
||||
|
||||
} else if (MmsSmsColumns.Types.isMessageRequestResponse(type)) {
|
||||
try {
|
||||
if (lastMessage.getRecipient().getAddress().serialize().equals(
|
||||
TextSecurePreferences.getLocalNumber(context))) {
|
||||
return UtilKt.getSubbedCharSequence(
|
||||
@ -152,6 +153,8 @@ public class ThreadRecord extends DisplayRecord {
|
||||
new Pair<>(NAME_KEY, getName())
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (Exception e){} // the above can throw a null exception
|
||||
|
||||
return context.getString(R.string.messageRequestsAccepted);
|
||||
} else if (getCount() == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user