some code clean up to fix some rare NPE’s
This commit is contained in:
parent
570a22206d
commit
9e20a4936e
|
@ -929,10 +929,10 @@ public class ConversationActivity extends XmppActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleViewConversationIntent(final Intent intent) {
|
private void handleViewConversationIntent(final Intent intent) {
|
||||||
final String uuid = (String) intent.getExtras().get(CONVERSATION);
|
final String uuid = intent.getStringExtra(CONVERSATION);
|
||||||
final String downloadUuid = (String) intent.getExtras().get(MESSAGE);
|
final String downloadUuid = intent.getStringExtra(MESSAGE);
|
||||||
final String text = intent.getExtras().getString(TEXT, "");
|
final String text = intent.getStringExtra(TEXT);
|
||||||
final String nick = intent.getExtras().getString(NICK, null);
|
final String nick = intent.getStringExtra(NICK);
|
||||||
if (selectConversationByUuid(uuid)) {
|
if (selectConversationByUuid(uuid)) {
|
||||||
this.mConversationFragment.reInit(getSelectedConversation());
|
this.mConversationFragment.reInit(getSelectedConversation());
|
||||||
if (nick != null) {
|
if (nick != null) {
|
||||||
|
|
|
@ -1019,6 +1019,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendText(String text) {
|
public void appendText(String text) {
|
||||||
|
if (text == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
String previous = this.mEditMessage.getText().toString();
|
String previous = this.mEditMessage.getText().toString();
|
||||||
if (previous.length() != 0 && !previous.endsWith(" ")) {
|
if (previous.length() != 0 && !previous.endsWith(" ")) {
|
||||||
text = " " + text;
|
text = " " + text;
|
||||||
|
|
Loading…
Reference in a new issue