mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 10:35: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() {
|
private fun restoreDraftIfNeeded() {
|
||||||
val mediaURI = intent.data
|
val mediaURI = intent.data
|
||||||
val mediaType = AttachmentManager.MediaType.from(intent.type)
|
val mediaType = AttachmentManager.MediaType.from(intent.type)
|
||||||
|
val mimeType = MediaUtil.getMimeType(this, mediaURI)
|
||||||
if (mediaURI != null && mediaType != null) {
|
if (mediaURI != null && mediaType != null) {
|
||||||
if (AttachmentManager.MediaType.IMAGE == mediaType || AttachmentManager.MediaType.GIF == mediaType || AttachmentManager.MediaType.VIDEO == mediaType) {
|
if (mimeType != null && (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())
|
val media = Media(mediaURI, mimeType, 0, 0, 0, 0, Optional.absent(), Optional.absent())
|
||||||
startActivityForResult(MediaSendActivity.buildEditorIntent(this, listOf( media ), viewModel.recipient!!, ""), PICK_FROM_LIBRARY)
|
startActivityForResult(MediaSendActivity.buildEditorIntent(this, listOf( media ), viewModel.recipient!!, ""), PICK_FROM_LIBRARY)
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
@ -144,14 +144,17 @@ public class ThreadRecord extends DisplayRecord {
|
|||||||
.format().toString();
|
.format().toString();
|
||||||
|
|
||||||
} else if (MmsSmsColumns.Types.isMessageRequestResponse(type)) {
|
} else if (MmsSmsColumns.Types.isMessageRequestResponse(type)) {
|
||||||
if (lastMessage.getRecipient().getAddress().serialize().equals(
|
try {
|
||||||
TextSecurePreferences.getLocalNumber(context))) {
|
if (lastMessage.getRecipient().getAddress().serialize().equals(
|
||||||
return UtilKt.getSubbedCharSequence(
|
TextSecurePreferences.getLocalNumber(context))) {
|
||||||
context,
|
return UtilKt.getSubbedCharSequence(
|
||||||
R.string.messageRequestYouHaveAccepted,
|
context,
|
||||||
new Pair<>(NAME_KEY, getName())
|
R.string.messageRequestYouHaveAccepted,
|
||||||
);
|
new Pair<>(NAME_KEY, getName())
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e){} // the above can throw a null exception
|
||||||
|
|
||||||
return context.getString(R.string.messageRequestsAccepted);
|
return context.getString(R.string.messageRequestsAccepted);
|
||||||
} else if (getCount() == 0) {
|
} else if (getCount() == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user