mirror of
https://github.com/moparisthebest/Conversations
synced 2024-12-25 08:58:55 -05:00
fixed possible npe
This commit is contained in:
parent
facd15f037
commit
0e56ff93e9
@ -57,7 +57,8 @@ public class NotificationService {
|
|||||||
mList.add(message);
|
mList.add(message);
|
||||||
notifications.put(conversationUuid, mList);
|
notifications.put(conversationUuid, mList);
|
||||||
}
|
}
|
||||||
updateNotification(!(this.mIsInForeground && this.mOpenConversation == null) || !isScreenOn);
|
updateNotification(!(this.mIsInForeground && this.mOpenConversation == null)
|
||||||
|
|| !isScreenOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
@ -195,6 +196,9 @@ public class NotificationService {
|
|||||||
public static boolean wasHighlightedOrPrivate(Message message) {
|
public static boolean wasHighlightedOrPrivate(Message message) {
|
||||||
String nick = message.getConversation().getMucOptions().getActualNick();
|
String nick = message.getConversation().getMucOptions().getActualNick();
|
||||||
Pattern highlight = generateNickHighlightPattern(nick);
|
Pattern highlight = generateNickHighlightPattern(nick);
|
||||||
|
if (message.getBody() == null || nick == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Matcher m = highlight.matcher(message.getBody());
|
Matcher m = highlight.matcher(message.getBody());
|
||||||
return (m.find() || message.getType() == Message.TYPE_PRIVATE);
|
return (m.find() || message.getType() == Message.TYPE_PRIVATE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user