aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java13
-rw-r--r--src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java24
2 files changed, 22 insertions, 15 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index d482b7326..129f5400e 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -625,10 +625,15 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
private void onEditYourNameClicked(View view) {
String nick;
- if (mAccount.getDisplayName() != null) {
- nick = mAccount.getDisplayName();
- } else {
- nick = mAccount.getJid().getLocal();
+ try {
+ if (mAccount.getDisplayName() != null) {
+ nick = mAccount.getDisplayName();
+ } else {
+ nick = mAccount.getJid().getLocal();
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ nick = "";
}
quickEdit(nick, R.string.your_name, value -> {
final String displayName = value.trim();
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
index 10eb977a7..df063bcdb 100644
--- a/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
+++ b/src/main/java/de/pixart/messenger/ui/adapter/MessageAdapter.java
@@ -264,15 +264,19 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
if (Message.ERROR_MESSAGE_CANCELLED.equals(errorMessage)) {
info = getContext().getString(R.string.cancelled);
} else {
- final String[] errorParts = errorMessage.split("\\u001f", 2);
- if (errorParts.length == 2) {
- switch (errorParts[0]) {
- case "file-too-large":
- info = getContext().getString(R.string.file_too_large);
- break;
- default:
- info = getContext().getString(R.string.send_failed);
- break;
+ if (errorMessage != null) {
+ final String[] errorParts = errorMessage.split("\\u001f", 2);
+ if (errorParts.length == 2) {
+ switch (errorParts[0]) {
+ case "file-too-large":
+ info = getContext().getString(R.string.file_too_large);
+ break;
+ default:
+ info = getContext().getString(R.string.send_failed);
+ break;
+ }
+ } else {
+ info = getContext().getString(R.string.send_failed);
}
} else {
info = getContext().getString(R.string.send_failed);
@@ -1091,9 +1095,7 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
if (type == SENT) {
viewHolder.message_box.setBackgroundResource(activity.isDarkTheme() ? R.drawable.message_bubble_sent_dark : R.drawable.message_bubble_sent);
}
-
displayStatus(viewHolder, message, type, darkBackground);
-
return view;
}