aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-03 11:55:38 +0200
committeriNPUTmice <daniel@gultsch.de>2014-10-03 11:55:38 +0200
commit0e56ff93e9df5ef80e1f2841fb5b9dca3161cd43 (patch)
tree45e3a265c2be74d736e6ac2ffa2425cecbae6a8f /src/eu/siacs
parentfacd15f0373913eaafe8aa3a9a65cd02d8269aba (diff)
fixed possible npe
Diffstat (limited to 'src/eu/siacs')
-rw-r--r--src/eu/siacs/conversations/services/NotificationService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/services/NotificationService.java b/src/eu/siacs/conversations/services/NotificationService.java
index eb2039091..9428aa15a 100644
--- a/src/eu/siacs/conversations/services/NotificationService.java
+++ b/src/eu/siacs/conversations/services/NotificationService.java
@@ -57,7 +57,8 @@ public class NotificationService {
mList.add(message);
notifications.put(conversationUuid, mList);
}
- updateNotification(!(this.mIsInForeground && this.mOpenConversation == null) || !isScreenOn);
+ updateNotification(!(this.mIsInForeground && this.mOpenConversation == null)
+ || !isScreenOn);
}
public void clear() {
@@ -195,6 +196,9 @@ public class NotificationService {
public static boolean wasHighlightedOrPrivate(Message message) {
String nick = message.getConversation().getMucOptions().getActualNick();
Pattern highlight = generateNickHighlightPattern(nick);
+ if (message.getBody() == null || nick == null) {
+ return false;
+ }
Matcher m = highlight.matcher(message.getBody());
return (m.find() || message.getType() == Message.TYPE_PRIVATE);
}