Prevent crash if icon is null
This commit is contained in:
parent
cf0f88e71e
commit
11b223c0dc
3 changed files with 19 additions and 7 deletions
|
@ -42,9 +42,17 @@ class ApiTwentyEightPlus {
|
||||||
Person me = new Person.Builder().setName(notif.getMyself()).build();
|
Person me = new Person.Builder().setName(notif.getMyself()).build();
|
||||||
Notification.MessagingStyle style = new Notification.MessagingStyle(me);
|
Notification.MessagingStyle style = new Notification.MessagingStyle(me);
|
||||||
for (NotifiableMessage message : notif.getMessages()) {
|
for (NotifiableMessage message : notif.getMessages()) {
|
||||||
Icon userIcon = Icon.createWithBitmap(message.getSenderBitmap());
|
Icon userIcon = null;
|
||||||
Person user =
|
if (message.getSenderBitmap() != null) {
|
||||||
new Person.Builder().setName(message.getSender()).setIcon(userIcon).build();
|
userIcon = Icon.createWithBitmap(message.getSenderBitmap());
|
||||||
|
}
|
||||||
|
|
||||||
|
Person.Builder builder = new Person.Builder().setName(message.getSender());
|
||||||
|
if (userIcon != null) {
|
||||||
|
builder.setIcon(userIcon);
|
||||||
|
}
|
||||||
|
Person user = builder.build();
|
||||||
|
|
||||||
Notification.MessagingStyle.Message msg =
|
Notification.MessagingStyle.Message msg =
|
||||||
new Notification.MessagingStyle.Message(
|
new Notification.MessagingStyle.Message(
|
||||||
message.getMessage(), message.getTime(), user);
|
message.getMessage(), message.getTime(), user);
|
||||||
|
|
|
@ -370,7 +370,11 @@ public class ContactsManager extends ContentObserver implements FriendListListen
|
||||||
|
|
||||||
String normalized = lpc.normalizePhoneNumber(phoneNumber);
|
String normalized = lpc.normalizePhoneNumber(phoneNumber);
|
||||||
if (normalized == null) {
|
if (normalized == null) {
|
||||||
Log.w("[Contacts Manager] Couldn't normalize phone number " + phoneNumber + ", default proxy config prefix is " + lpc.getDialPrefix());
|
Log.w(
|
||||||
|
"[Contacts Manager] Couldn't normalize phone number "
|
||||||
|
+ phoneNumber
|
||||||
|
+ ", default proxy config prefix is "
|
||||||
|
+ lpc.getDialPrefix());
|
||||||
normalized = phoneNumber;
|
normalized = phoneNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class ConfigureAccountActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
// This will automatically create the proxy config and auth info and add them to the Core
|
// This will automatically create the proxy config and auth info and add them to the Core
|
||||||
ProxyConfig cfg = mAccountCreator.configure();
|
ProxyConfig cfg = mAccountCreator.createProxyConfig();
|
||||||
// Make sure the newly created one is the default
|
// Make sure the newly created one is the default
|
||||||
LinphoneService.getCore().setDefaultProxyConfig(cfg);
|
LinphoneService.getCore().setDefaultProxyConfig(cfg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue