forked from Ivasoft/mattermost-mobile
Verify that the push notification version is not null (#1736)
This commit is contained in:
@@ -146,7 +146,7 @@ public class CustomPushNotification extends PushNotification {
|
||||
String version = bundle.getString("version");
|
||||
|
||||
String title = null;
|
||||
if (version.equals("v2")) {
|
||||
if (version != null && version.equals("v2")) {
|
||||
title = bundle.getString("channel_name");
|
||||
} else {
|
||||
title = bundle.getString("title");
|
||||
@@ -217,7 +217,7 @@ public class CustomPushNotification extends PushNotification {
|
||||
} else {
|
||||
String summaryTitle = null;
|
||||
|
||||
if (version.equals("v2")) {
|
||||
if (version != null && version.equals("v2")) {
|
||||
summaryTitle = String.format("(%d) %s", numMessages, title);
|
||||
} else {
|
||||
summaryTitle = String.format("%s (%d)", title, numMessages);
|
||||
@@ -232,7 +232,7 @@ public class CustomPushNotification extends PushNotification {
|
||||
list = new ArrayList<Bundle>();
|
||||
}
|
||||
|
||||
if (version.equals("v2")) {
|
||||
if (version != null && version.equals("v2")) {
|
||||
style.addLine(message);
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ public class CustomPushNotification extends PushNotification {
|
||||
}
|
||||
}
|
||||
|
||||
if (version.equals("v2")) {
|
||||
if (version != null && version.equals("v2")) {
|
||||
notification
|
||||
.setContentTitle(summaryTitle)
|
||||
.setContentText(message)
|
||||
|
||||
Reference in New Issue
Block a user